You are currently viewing PHP Conditional Statements

PHP Conditional Statements

  • Post author:
  • Post category:Beginner Tutorials / PHP
  • Post last modified:July 7, 2021
  • Reading time:1 mins 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…