Acquiring Date Information with getdate() : getdate « Date « PHP






Acquiring Date Information with getdate()

 
<html>
<head>
<title>Acquiring Date Information with getdate()</title>
</head>
<body>
<div>
<?php
$date_array = getdate(); 
foreach ( $date_array as $key => $val ) {
  print "$key = $val<br/>";
}
?>
<hr/>
<p>
<?
print "Today's date: ";
print $date_array['mon']."/".$date_array['mday']."/".$date_array['year'];
?>
</p>
</div>
</body>
</html>
  
  








Related examples in the same category

1.Return array from getdate( )
2.The Associative Array Returned by getdate()
3.To obtain a number corresponding to the day of the week, use getdate() instead:
4.getdate() with a specific timestamp
5.Finding the month, day, and year