if
Statement
if
, elseif
, and else
statements in PHP are used to perform different actions based on different conditions.
if...else
statement—use this statement if you want to execute a set of code when a condition is true and another if the condition is not true.
elseif
statement—is used with the if...else
statement to execute a set of code if one of several condition are true.
if
...else
Statement
|
![]() |
gmdate
function formats a local time/date.
<html><body> <?php $day = gmdate( "D" ); if ( $day == "" ) { echo '$day'; } else echo "$day"; ?> </body></html> Output = |
<html><body> <?php $hour = gmdate( "H" ); if ( $hour > ) echo 'date("Y")'; else echo "date('Y')"; ?> </body></html> Output =
|
My girlfriend needs “space.” And this is what space means, guys. It means, “I need you to help me break up with you.” — Yannis Pappas |