The printf() function prints to the output of your program, while sprintf() sends its output to a variable that you specify as one of its parameters.
Solution to Question 11-2
Check whether or not the date 1/31/2045 is valid as follows:
if (checkdate(1,31,2045)) { echo('Date is valid.'); } else { echo ('Invalid date.'); }
Solution to Question 11-3
To display the day of the week for 1/31/2045, you must first create a timestamp for that date. The l in the format string for date() indicates that the full day of the week displays.