Example
The following is a code snippet that you might save on your server. The snippet looks similar to HTML except for the line beginning with <?php which tells the server to start parsing for PHP and ?> which tells the server to stop parsing for PHP. The echo statement outputs one or more strings. Here the echo statement echoes out the string returned from the date function. The date function returns the current date in the format of Day_of_the_week, Month Day, Year, Hour:Minute AM_or_PM.
PHP Source Code.
<html><head><title>PHP Test</title></head>
<body> <?php echo
date("l, F j, Y, g:i A");
?> </body></html>
|
PHP Source Code Executed
Sunday, September 5, 2010, 8:15 AM
|