Format date as 'g:i:s a' in PHP
Description
The following code shows how to format date as 'g:i:s a'.
Example
/* w w w. j a v a 2 s.c om*/
<!DOCTYPE html>
<html>
<body>
<h1>
<?php
$currentTime = date( "g:i:s a" );
echo "Hello, world! The current time is $currentTime";
?>
</h1>
</body>
</html>
The code above generates the following result.