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);
?>
  1. 01-Feb-2021 12:13:14pm
  2. 01-feb-2021 14:13:12pm
  3. 02-Jan-2021 12:13:14pm
  4. 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)

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.