RE: [PHP] Is there a shorthand way to...?
| From: | Ford, Mike | Date: | Mon, 22 Nov 2004 14:47:20 +0000 |
| Subject: | RE: [PHP] Is there a shorthand way to...? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202678@lists.php.net to get a copy of this message | ||
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
On 22 November 2004 14:01, Al wrote:
> When handling $_POST[] values that may or may not be
> assigned, I am forever using:
>
> if((isset($_POST['courses_list']) AND
> $_POST['courses_list']== 'Used'))
>
> Is there a shorthand way of doing this without causing notice errors?
For genuine one-offs, I tend to use:
if (@$_POST['courses_list']=='Used')
Otherwise, if I'm making multiple accesses to the $_POST[] element, I use
one of the other techniques already posted.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211