开发者

can't access php DateTime contents

I've got a variable that upon var_dump prints this.

It contains a date, but I just don't know how to access the date data, if I put

$myVariable[date] OR $myVariable["date"] OR $myVariable['date'] all result in error.

object(Dat开发者_运维知识库eTime)#8 (3) { 
    ["date"]=> string(19) "2011-07-25 00:00:00"
    ["timezone_type"]=> int(3)
    ["timezone"]=> string(16) "Europe/Stockholm"
}

I don't understand what the first number is either, the #8 right after the (DateTime)...


echo $myVariable->format('Y-m-d H:i:s');

(thanks to kmfk for that answer)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜