Menggunakan If Kondisi PHP

Cara menggunakan kondisi if di dalam PHP:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Kondisi PHP</title>
    </head>
    <body>
        <?php
        $hari = date("D");
        if($hari == "Sun")
        {
            echo 'Libur Bero!';
        }  else 
            {
            echo 'Yaah masuk...';
            }
        ?>
    </body>
</html>

Silakan ditest.

Leave a Reply

Your email address will not be published. Required fields are marked *