Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-24-2008, 12:05 AM   PM User | #1
kejo
New Coder

 
Join Date: Jan 2008
Posts: 31
Thanks: 4
Thanked 0 Times in 0 Posts
kejo is an unknown quantity at this point
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
kejo is offline   Reply With Quote
Old 02-24-2008, 01:08 AM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:46 PM.


Advertisement
Log in to turn off these ads.