> -----Original Message----- > From: Ron Dyck [mailto:[EMAIL PROTECTED]] > Sent: 18 February 2002 13:38 > [... snip working example] > > but, this doesn't: > > function myFunction() { > foreach($_POST as $key=>$value) { > > if (empty($$key)) { > print "empty value $key<br>"; > } > > } > }
What's wrong with: if (empty($_POST[$key])): ? This should work whether or not register_globals is switched on, and is therefore much to be preferred. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php