Tag: equals to explain set meaning a performance and define fun
In general we will write this:
if ($_get[' time ']==null$timetimeelse$ time$_get[' Time 'echo$time//
If only simple judgment, according to the above writing is too troublesome, and the performance is not high!
Can be changed to use ternary one-time:
$time = ($_get[' time ']==null)? (Time ()): ($_get[' Time 'echo$time
Much more concise!
Probably explain the meaning of ternary one-time
If the sentence inside the first parenthesis () is set, the question mark is executed? The contents of the first parenthesis (), if not, execute the question mark? The contents of the second parenthesis ()
$a // $b//$c = ($a= =$b)? ("Yes"): ("No"//
There is also a simplified
$bool = true;
if ($bool)
{
Setvaluefun ();
}
can be simplified into
$bool && setvaluefun ();
PHP IF Else simplified/ternary one-time use