Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2007
    Posts
    219
    Thanks
    25
    Thanked 1 Time in 1 Post

    retrieve url parameter

    Let's say I've got this url:

    http://www.mydomain.com/test/product/free

    How can I store the values 'test', 'product' and 'free' each in seperate variables ?

    I've searched it with google, but couldn't find it.

  • #2
    Regular Coder
    Join Date
    May 2011
    Posts
    242
    Thanks
    1
    Thanked 57 Times in 56 Posts
    PHP Code:
    list(, $var1$var2$var3) = explode("/"$_SERVER['REQUEST_URI']); 
    or
    PHP Code:
    $path explode("/"$_SERVER['REQUEST_URI']);
    array_shift($path); 

  • Users who have thanked gvre for this post:

    docock (09-26-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •