Question
3. [20 pts] PHP This question is a continuation of question 2., but from the server side. a) Write a PHP snippet that extracts the
3. [20 pts] PHP
This question is a continuation of question 2., but from the server side. a) Write a PHP snippet that extracts the two dates from the incoming data and store them in variables $date1 and $date2.
b) Create an array called $dates and fill it with 5 random dates in the range between $date1 and $date2 inclusive. The dates must be valid!! Hint #1: Recall that to get random integer numbers in the range [x,y] use predefined function mt_rand(x,y); Hint #2: If you are thinking that this problem does not need timestamps, you are wrong. Think again.
c) Write a PHP snippet that creates a table of the 5 random dates you have generated. Hint: date("d/m/Y", $ts); will be helpful.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started