Questions

IIF function

IIF function :-

IIF stands for Immediate IF, this is a well-known function in most languages but unfortunately PHP does not contain such a function. PHPkit provide the functon as follows,


Syntax :-

IIF(condition , true statment , false statment ) ;

IIF function
The PHP code given bellow
<?php
function iif($condion, $true, $false ) {
    return ($condition ? $true : $false);
}
?>

Your Answers

Your Name:
Your Answers :
<> is a code tag
Preview
Enter the verification code:

Answers

User
Mar 18 13 09:10:45

You can write:

$a = $condition ? $result_if_true : $result_is_false;

and have same functionality without any special function.


Ser
Mar 28 12 08:16:53
I think this will make your case

(CONDIZIONE)?AZIONE TRUE:AZIONE FALSE;

uuu
Nov 03 11 09:43:24
guy above is dumb

Roseanna
Sep 10 11 07:14:49
This could not posislby have been more helpful!

JW
Mar 18 10 01:04:24
There is an error in your function, first parameter $condion should be $condition