All vars in a url

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!

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

All vars in a url

Post by Todd_Z »

How do i get an array of all the variables listed in the current url. I.E. something that would result in the same as

Code: Select all

<?php
    $vars = array("page"=>"home", "style"=>"red", "category"=>"three");
?>
Thanks.
DrHoliday
Forum Newbie
Posts: 11
Joined: Mon Dec 06, 2004 5:12 pm
Location: Germany

Post by DrHoliday »

That would be $_GET:

Code: Select all

echo "<pre>";
print_r($_GET);
echo "</pre>";
Wolfgang
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

Thanks, my fault for not consulting the docs first, prolly woudda been a quick find.
Post Reply