What about this?

  $required = array('name','address','phone');
  while ( list($key, $value) = each ($required) )  {
    if ( empty($value) ) {
      print("Sorry, you left $key empty.");
    }
  }

----- Original Message ----- 
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 2:22 PM
Subject: [PHP] Re: Re: How do I convert from perl to php?


You could do something like this... there are lots of ways to validate
your data...

while( list($key, $value) = each($HTTP_POST_VARS) )  {
if( empty($value) )  {
print("Sorry, you left $key empty.");
}
}




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to