Someone posted a topic on the last forum asking about a link he encountered.
It showed something like index.php?1,3,4,5,3 in the adress bar.
Right now my stuff is all like indexp.php?id=5&blabla=blabla and such very long strings.
Can someone perhaps explain how the nice thing he saw works?
LC
still wondering
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
lets say you have this URL:
$url = "http://www.domain.com/something.php?1,2,3,4,5";
doing a parser_url will give you an array:
$url_array = parse_url($url);
everything following the ' ? ' in the url will be stored as such:
$url_array[query]; //contains "1,2,3,4,5"
$url = "http://www.domain.com/something.php?1,2,3,4,5";
doing a parser_url will give you an array:
$url_array = parse_url($url);
everything following the ' ? ' in the url will be stored as such:
$url_array[query]; //contains "1,2,3,4,5"
You can just use $_SERVER['QUERY_STRING'] without the need of parse_url().
That's via file.php?1,2,3,4,5
Code: Select all
$parts = explode(',', $_SERVERї'QUERY_STRING']);
print_r($parts);
// Array ( ї0] => 1 ї1] => 2 ї2] => 3 ї3] => 4 ї4] => 5 )