...

View Full Version : how to split an url in 2 parts?? (i dont need parse_url)



kejo
02-24-2008, 12:05 AM
hello
i would like to split:

www.site.com/page.php?q=SPLITHERE&cat=0&others=1
into

www.site.com/page.php?q=
and

&cat=0&others=1

how can i do that?
i tried with explode, but it didnt work.

please help :)

oesxyl
02-24-2008, 01:08 AM
hello,



$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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum