[EMAIL PROTECTED] writes:
>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);
You can do this
($a=='H') ? my_function($bob,'Y'): 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'; );
>
Also, if you change this
>if($a=='H') return 'Y'
to a function ie foo(a){
>if($a=='H') return 'Y'
;}. Then, put foo(a) in my_function, I think it would work.
Pong
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php