Shprehja If…Else
Shembull:
<?php
$d=date("D");
if ($d=="Fri") echo "Have a nice weekend!";
else echo "Have a nice day!";
?>
Shprehja ElseIf
Nese deshironi qe te ekzekutoni kod nese njeri nga kushtet eshte i vertete, perdorni shprehjen elseif.
Shembull:
<?php
$hour = date("H");
if ($hour <= 11) {
echo "good morning my friend"; }
elseif ($hour > 11 && $hour < 18) {
echo "good afternoon my friend"; }
else { echo "good evening my friend"; }
?>