Save result of getdate() to an array : Date Time « Development « PHP






Save result of getdate() to an array

<?php
$date_array = getdate(); // no argument passed so today's date will be used
foreach ($date_array as $key => $val) {
  echo "$key = $val<br>";
}
?>
<hr/>
<?php
echo "<p>Today's date: ".$date_array['mon']."/".$date_array['mday']."/".$date_array['year']."</p>";
?>



           
       








Related examples in the same category

1.date: m/d/y G:i:s e
2.date: jS \o\f F Y, \a\\t g:ia \i\\n e
3.Call system date function and get result
4.String time
5.String matches: /p.p/
6. December 16th 2002, 09:17AM.
7.Today's Date
8.Get date and time