PHPIFELSE simplifies the use of the trigger once. Generally, we write the following code :? If ($ _ GET [time] null) {$ timetime ();} else {$ time $ _ GET [time];} echo $ time; if GET has the value of time, the variable is generally written as follows:
The code is as follows:
If ($ _ GET ['Time'] = null)
{
$ Time = time ();
}
Else
{
$ Time = $ _ GET ['Time'];
}
Echo $ time;
// If GET has time, the variable time is included. if not, the current time () time is included.
?>
If you only make a simple judgment, it will be too troublesome to write as above, and the efficiency is not high!
You can change it to the triplicate method:
The code is as follows:
$ Time = ($ _ GET ['Time'] = null )? (Time (): ($ _ GET ['Time']);
Echo $ time;
?>
Concise!
I would like to explain the meaning of a trigger.
If the sentence in the first parentheses () is true, the question mark is executed? If the content of the first parentheses () is not true, the question mark is executed? Content of the second bracket ()
The code is as follows:
$ A = 5; // define variable a = 5
$ B = 3; // define variable B = 5
$ C = ($ a = $ B )? ("Yes"): ("no ");
// If a = B, c = yes; a is not equal to B, c = no
?>
There is also a simplified
The code is as follows:
$ Bool = true;
If ($ bool)
{
SetValueFun ();
}
Can be simplified
The code is as follows:
$ Bool & setValueFun ();
The pipeline code is as follows :? If ($ _ GET ['Time'] = null) {$ time = time ();} else {$ time = $ _ GET ['Time'];} echo $ time; // if GET has time, the variable is included...