PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
Hope you can get me going with this:
I've got the following URL:
$url = 'http://mysite.com/abc/xsl/search?q=dc.date.lastmodified:%5b2007-05-01T00:00:00Z%20TO%202007-05-19T00:00:00Z%5d&user=username&sr=resource&type=rss';
$q_str = parse_url($url, PHP_URL_QUERY);
print $q_str;
// that would give me something like this:
// q=dc.date.lastmodified:%5b2007-05-01T00:00:00Z%20TO%202007-05-19T00:00:00Z%5d&user=username&sr=resource&type=rss
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Thanks for that.
I get that already with [b]parse_url[/b]:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax] tags in your future posts.
As for parsing the query string (which we all understood, by the way) you can use explode() to split it at certain strings (like & or =) or you can use split() or preg_split() if you want to use a regular expression.
If all you want is an array of the keys and values passed, look at the $_GET superglobal.