Easy method to search for existence of $_GET and $_POST vars

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
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Easy method to search for existence of $_GET and $_POST vars

Post by anjanesh »

Just wanted to know if theres an easier way to check this

Code: Select all

if (
   isset($_GET['a'])  &&
   isset($_GET['ab']) &&
   isset($_GET['c'])  &&
   isset($_GET['e'])  &&
   isset($_GET['z'])  &&
   isset($_GET['fg']) &&
   isset($_GET['hj'])
)
   {
   	// Do Something
   }
If there is please let me know.
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pass an array of keys to a function, along with the array to check into... ?
Post Reply