PHP Conditional Statements

  • 1 min read

In this example, we will discuss php conditional statements. PHP supports the following conditional statements.

  • if conditional statement
  • if…..else conditional statement
  • if….elseif…..else conditional statement
  • switch… conditional statement

The if Statement

This is used to executed a block of code when the if condition is true.

    // Code to be executed


    $d = date("D"); 
    if($d == "Fri"){     
    echo "Have a nice weekend!"; 

Updated soon…