Created
September 8, 2017 06:46
-
-
Save makzan/8ed267b99f04222cddf45288570e9e93 to your computer and use it in GitHub Desktop.
Basic PHP example on getting today's day
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $name = "Thomas"; | |
| $day = date( "l"); | |
| ?> | |
| <!DOCTYPE html> | |
| <title>Hello PHP</title> | |
| <h1>Hello <?= $name ?></h1> | |
| <p> | |
| It's <?= $day ?> today. | |
| <?php if ($day == "Saturday"): ?> | |
| Happy Weekend! | |
| <?php endif; ?> | |
| <?php if ($day == "Sunday"): ?> | |
| Happy Sunday! | |
| <?php endif; ?> | |
| </p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment