use IF condition for variable assignment

by Guna 2012-06-02 21:15:36

Hi,

Other than checking the variable state, we can use conditional operators for assigning purpose also. Below
i've given one of the example.

Sample:

function add($v){
return ($v+$v);
}
if($str=add(5)){
echo $str;
}

Tagged in:

1330
like
0
dislike
0
mail
flag

You must LOGIN to add comments