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
    New Coder
    Join Date
    Jan 2008
    Posts
    31
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Exclamation how to split an url in 2 parts?? (i dont need parse_url)

    hello
    i would like to split:
    into
    and
    Code:
    &cat=0&others=1
    how can i do that?
    i tried with explode, but it didnt work.

    please help

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    hello,

    PHP Code:
    $url "www.site.com/page.php?q=SPLITHERE&cat=0&others=1";
    $first explode("?",$url);
    print_r($first);
    $second explode("&",$first[1]);
    print_r($second);
    $last explode("=",$second[0]);
    print_r($last); 
    best regards


  •  

    Posting Permissions

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