The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.
1: | Using PHP, how do you acquire a Unix timestamp that represents the current date and time? What about using MySQL? |
A1: | In PHP, use time(). In MySQL, use UNIX_TIMESTAMP(). |
2: | Which PHP function accepts a timestamp and returns an associative array that represents the given date? |
A2: | The getdate() function returns an associative array whose elements contain aspects of the given date. |
3: | Which PHP function do you use to format date information? What about using MySQL? |
A3: | In PHP, use date(). In MySQL, use DATE_FORMAT(). |
4: | Which PHP function could you use to check the validity of a date? |
A4: | You can check a date with the checkdate() function. |
Create a birthday countdown script. Given form input of month, day, and year, output a message that tells the user how many days, hours, minutes, and seconds until the big day. Use whatever combination of PHP and MySQL functions you want.