PHP process control and php process. PHP process control. The php-if statement of the PHP process is used to execute code only when the specified condition is set. Syntax if (condition) {code to be executed when the condition is set;} if the current time is less than the PHP process control, the php process
PHP-if statement
If statement is usedRun the code only when the specified condition is set..
Syntax
If (condition) {code to be executed when the condition is set ;}
If the current time is less than 20, the following instance will output "Have a good day! ":
Instance
Run
PHP-if... else statement
Execute one piece of code when the conditions are met, and execute another piece of code when the conditions are not met., Use the if... else statement.
Syntax
If (condition) {code executed when the condition is set;} else {code executed when the condition is not set ;}
If the current time is less than 20, the following instance will output "Have a good day! ", Otherwise output" Have a good night! ":
PHP-if... else statement
Execute a code block when several conditions are created., Use the if... else statement ..
Syntax
If (condition) {code executed when the if condition is set;} else if (condition) {code executed when the elseif condition is set;} else {code executed when the condition is not set ;}
If the current time is less than 10, the following instance will output "Have a good morning! ", If the current time is not less than 10 and less than 20, the output" Have a good day! ", Otherwise output" Have a good night! ":
Address: http://www.manongjc.com/php/php_if_switch.html
Related reading:
Php date_sunrise () obtains the sunrise time based on the location (longitude and latitude)
Php global legal time zone list
Php date_default_timezone_set () sets the default time zone of the date/time function
Php date_default_timezone_get () gets the default time zone used by the DATETIME function
Php checkdate () function verification date is valid (correct)
Essential for watching the sunrise in Taishan
The if statement of the Alternative PHP-if statement is used to execute code only when the specified condition is set. Syntax if (condition) {code to be executed when the condition is set;} if the current time is less...