I am trying to echo a variable inside a object array..
array(4)
{
[0]=> int(20)
[1]=> string(16) "Demo Blog Post 3" [2]=> string(753) "Lorem ipsum dolor sit"
[3]=> object(DateTime)#1 (3)
{
["date"]=> string(19) "2016-02-19 13:28:23"
["timezone_type"]=> int(3)
["timezone"]=> string(11) "Asia/Muscat"
}
}
I want the date object in this array... how can I get this... ?
$times = $row[3]->date; // Returning NULL
echo count($times); // 1
$times = $row[3]['date']; // Returning CodeBreak.
var_dump($row[3])
object(DateTime)#1 (3) {
["date"]=> string(19) "2016-02-19 13:28:23"
["timezone_type"]=> int(3)
["timezone"]=> string(11) "Asia/Muscat"
}
var_dump(get_object_vars($row[3]))
array(3)
{
["date"]=> string(19) "2016-02-19 13:28:23"
["timezone_type"]=> int(3)
["timezone"]=> string(11) "Asia/Muscat"
}
Thanks...