I am looking for information on PHP - IIF function. Does any how to declare PHP - IIF function and what are uses of this IIF function. Any recommendations and suggestions are appreciated.
I am looking for information on PHP - IIF function. Does any how to declare PHP - IIF function and what are uses of this IIF function. Any recommendations and suggestions are appreciated.
IIF stands for Immediate IF, this is a well-known function in most languages but unfortunately PHP does not contain such a function.iif() is handy for true and false returns. However if you use it to test and then pass data, if the data chunk is large, it may be much more inefficent then a plain old if/else. PHPkit provide the functon as follows,Syntax :- IIF(condition , true statment , false statment ).
In Access, the iif function returns one value if a specified condition evaluates to TRUE, or another value if it evaluates to FALSE.
In computing, IIf is a function in several editions of the Visual Basic programming language, It is an example of a conditional expression, which is similar to a conditional statement.You can use IIf anywhere you can use expressions. You use IIf to determine if another expression is true or false. IIf always evaluates both truepart and falsepart, even though it returns only one of them.
iif function in php :
Code:<?php function test ($test1) { return $test1 ? 'true' : 'false' ; } echo test1(1); echo '<br>'; echo test1(0); ?>
Bookmarks