Followings are the basic example of an if then else control structure. <?php $a = 3; if ($a <= 5) { echo "value is smaller or equal to 5"; } else { echo "value…