Lab 5: PHP

Use PHP variables, arrays, and constants embedded inside html code

Create a lab5.php file at C:\wamp\www\labs\lab5 with the following PHP constant and array variables

<?php
define ("DESIRED_LENGTH", 31);
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
$daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
?>

Use XHTML Strict and embedded PHP code to create the following page consisting of a heading 1 and a table

lab5

Switch pair programming roles

Switch driver and navigator roles. You may be able to just slide the keyboard and mouse over, or it may be preferable to change seats. Do not change the computer in use however.

Use PHP functions in an web page

Use HTML and PHP to add a paragraph under the table that displays the names of the months with the exact same number of days as defined by the constant DESIRED_LENGTH

lab2 with added paragraph