Get array representation for a Date in PHP

Description

The following code shows how to get array representation for a Date.

Example


<?php/*from  w  w w  .  j a  va2s .  c  o  m*/

$date = new Date();
$date->setDMY(29,4,2010);
$dcs = $date->getArray();
echo "The month: ".$dcs['month']."<br />";
echo "The day: ".$dcs['day']."<br />";
echo "The year: ".$dcs['year']."<br />";

?>




















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone