In this exercise, you will write a simple PHP script from scratch. The script will declare a variable called
$today that stores the day of the week.
You must save the file in the c:\XAMPP\htdocs\Webucator\ClassFiles directory path.
$todaythat holds the current day of the week as literal text.
$todayin the title and body of the page.
Instead of assigning a literal string (e.g, "Monday") to
$today, use the built-in
date() function so that the script won't have to be manually updated every day to stay current. For documentation, visit http://www.php.net/date.
<?php $today = 'Monday'; ?> <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title><?php echo $today; ?></title> </head> <body> <?php echo $today; ?> </body> </html>
<?php $today = date('l'); ?> ---- C O D E O M I T T E D ----