simple function question.
| From: | Jeff Bearer | Date: | Wed, 10 Apr 2002 14:13:01 +0000 |
| Subject: | simple function question. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92395@lists.php.net to get a copy of this message | ||
this is a very simple question. I'm trying to figure out if there is a
one line way to do this:
I want to pass a variable to the function only if it matches a certin
value, I know I can do this:
if($a=='H') my_function($bob,'Y');
else my_function($bob);
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 know that return doesn't work, and echo wouldn't work either, can you
even put a if statement inside a function call?
--
Jeff Bearer, RHCE
Webmaster
PittsburghLIVE.com
2002 EPpy Award, Best Online U.S. Newspaper