RE: [PHP] simple function question.
| From: | Ford, Mike [LSS] | Date: | Thu, 11 Apr 2002 09:42:29 +0000 |
| Subject: | RE: [PHP] simple function question. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92534@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jeff Bearer [mailto:jbearer@pittsburghlive.com]
> Sent: 10 April 2002 15:13
>
[snip]
>
> but If it's possible I'd like to do it with one line
> something that I'd
> think it would be like this.
>
> my_function($bob,if($a=='H') return 'Y'; );
I think the nearest you can get to this would be something like:
my_function($bob, $a=='H'?'Y':NULL);
but then my_function has got to know to expect a NULL instead of a missing parameter...!
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: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211