Home »
MCQs »
PHP MCQs
What will be the output of the following PHP code (if the date is 30th December 2021) | 1?
142. What will be the output of the following PHP code (if the date is 30th December 2021)?
<?php
$d=mktime(12, 13, 14, 1, 2, 2021);
echo date("d-M-Y h:i:sa", $d);
?>
- 01-Feb-2021 12:13:14pm
- 01-feb-2021 14:13:12pm
- 02-Jan-2021 12:13:14pm
- 02-Jan-2021 14:13:12pm
Answer: C) 02-Jan-2021 12:13:14pm
Explanation:
The PHP mktime() function is used to get the Unix timestamp for a given date. The order of the parameters is,
mktime(hour, minute, second, month, day, year)