Home »
MCQs »
PHP MCQs
Which is the correct PHP statement to print the current date in DD-MON-YYY format?
134. Which is the correct PHP statement to print the current date in DD-MON-YYY format?
- <?php echo date("DD-MON-YYYY"); ?>
- <?php echo date("dd-mon-yyyy"); ?>
- <?php echo date("d-m-y"); ?>
- <?php echo date("d-M-Y"); ?>
Answer: D) <?php echo date("d-M-Y"); ?>
Explanation:
The correct PHP statement to print the current date in DD-MON-YYYY format is:
<?php echo date("d-M-Y"); ?>