Loop Through PHP Request Values – GET and POST

Loop through PHP Request Values

In order to Loop through PHP Request Values – GET and POST without knowing what they all might be, you can simply use the following code:

	
foreach ($_REQUEST as $key => $value)  
{  
$value = mysql_real_escape_string( $value );  
$value = addslashes($value);  
$value = strip_tags($value);  
if($value != ""){$requestnumber ++;}  
echo $key. ' - '.$value.'
'; }

This is useful when you have an undetermined/unknown set of POST or GET values that you would like to loop through.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.