Question: You have a PHP array called inventory. This array is indexed by keys. The keys are product names and the values are expiration dates. The

 You have a PHP array called inventory. This array is indexed

You have a PHP array called inventory. This array is indexed by keys. The keys are product names and the values are expiration dates. The expiration dates are in the format MM/DD/YYYY. The array might look something like: $inventory array("Milk" "03/2/2013", "Cheese" "04/02/1990", "flour" "05/06/2027"): Get the current time and create an XHTML table where the first column consists of keys in this array and the second column consists of dates. For each table row write a class attribute with one of 3 values: normal, attention, urgent. The table row should get one of 3 class attributes depending on the date. If the product's expiration date is more than a week away (7 days away in the future), the class attribute's value should be normal. If the product's expiration is 3 days in the future, the class attribute should be attention. If the product is expiring today or has already expired, the class attribute should be urgent

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!