Dynamic Array Index using Variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to do something like this to check if a variety of submitted
form fields (crn, instructor, etc) have any value in them:

$reqfields = array('crn', 'instructor');
$errorflag = 0;

foreach ($reqfields as $field) {
	if ($_REQUEST[$field] == '') {
		$errorflag = 1;
	}
}

But I can't quite get the syntax right... help??

c

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux