can write if and else function when calling a function?
example:
func_name(arg_1, ard_2); can i do this? if s != 0 or empty then pass write the default value of arg_1 in a function. func_name( if($s == 0){ echo "True"; }, if($i == 3){ echo "1"; });
No, but try...
if( $s == 0 ) $foo[] = 'True'; if( $i == 3 ) $foo[] = '1'; $stuff = implode( ',', $foo ); func_name( $stuff );
Try this:
func_name( ($s == 0) ? 'True' : 'False', ($i == 3) ? '1' : '0'); [\php]
and how can i call function when im calling a function? example:
myfunction( anotherfunction(), 'ok' );
As long as "anotherfunction()" returns something (with a return statement) it will work the way you have it.
http://www.phpbuilder.com/manual/functions.returning-values.php