Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    PHP elseif statement

    else if statements in PHP is like another if condition, it's used in the program when if statement having multiple decisions.

    Figure - Flowchart of else if Statement:

    php-elseif

    Example of a PHP Program to Demonstrate else if Statement

    Example:

    <?php 
    $date=date("m-d"); 
    
    if ($date=="01-10") { 
      echo "Wishing you a very Happy Birthday"; 
    }
    elseif($date=="08-15"){
      echo "Happy Independence Day"; 
    }
    else{
      //nothing
    }
    ?>


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.