Q:

Write a PHP script to print the current date in the following format

0

Write a PHP script to print the current date in the following format.

Sample format : (assume current date is September 01, 2013)
2013/09/01
13.09.01
01-09-13

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
echo date("Y/m/d") . "\n";
echo date("y.m.d") . "\n";
echo date("d-m-y")."\n";
?>

Sample Output:

2017/02/16                                                  
17.02.16                                                    
16-02-17

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now