Jump to content

[SOLVED] Check get isset


EchoFool

Recommended Posts

Is it possible to get check $_GET is set regardless of what type of $_GET is set?

 

So say theres like 10 $_GET urls on one page. Rather than checking one at a time like this:@

 

 if (isset($_GET['test']) OR isset($_GET['test'])) 

 

Is there a way to just do if(isset($_GET['wildcard']))

 

So the wild is to check for anything? =/ Would help shorten my script quite a lot lol :P

Link to comment
https://forums.phpfreaks.com/topic/87105-solved-check-get-isset/
Share on other sites

eep error in mine.

 

<?php

$get = count($_GET);

if($get > 0){
foreach($_GET as $name => $value){
	echo $name . " has the value of " . $value . "<br>\n";
}
}else {
echo "There are no valid get parameters in the URL!";
}

?>

 

when my url looks like: http://localhost/test/get.php?1=2&3=4&5=6

 

my results:

 

1 has the value of 2
3 has the value of 4
5 has the value of 6

 

when my url looks like: http://localhost/test/get.php

 

my results:

 

There are no valid get parameters in the URL!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.