Thursday, 25 October 2012

Example: Now!

Let's try to extend the example by writing both a string and a function - separated by "." (a period) - it's done like this:

<html>
  <head>
     <title>My first PHP document</title>
  </head>
    <body>

 <?php 
 
 echo "<p>Current date and time: " . date("r") . "</p>";

 ?>

    </body>
</html>
 
It will look like this in the browser:
 
 










No comments:

Post a Comment