PHP Code Explanation 1

<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
echo "Today is " . date("l");
?>
  • – The code is a PHP script that outputs the date in different formats.
  • – The first line of code is an echo statement, which displays the string “Today is ” followed by a space and then the value of date(“Y/m/d”).
  • – This output will be displayed on screen.
  • – The second line of code is an echo statement, which displays the string “Today is ” followed by a space and then the value of date(“Y-m-d”).
  • – This output will also be displayed on screen.
  • – The third line of code is an echo statement, which displays the string “Today is “.
  • – This output will not be displayed on screen because it ends with a semicolon (;).
  • – The code prints out the following: – Today is Wednesday.

Leave a Comment