Skip to content

Instantly share code, notes, and snippets.

@makzan
Created September 8, 2017 06:46
Show Gist options
  • Select an option

  • Save makzan/8ed267b99f04222cddf45288570e9e93 to your computer and use it in GitHub Desktop.

Select an option

Save makzan/8ed267b99f04222cddf45288570e9e93 to your computer and use it in GitHub Desktop.
Basic PHP example on getting today's day
<?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