如何从JSON
获取PHP日期时间?JSON数组到PHP日期时间
$params = array();
$content = json_decode($request->getContent(), true);
if(empty($content))
{
throw $this->createNotFoundException('JSON not send!')
}
$content['date']
需要被smomething像$date = new DateTime();
JSON的样子:
{
"date" : "2017-02-15 15:20:14"
}
日期是通过你的JSON代码? – Sona
对不起,我忘了。 JSON看起来像:{“date”:“2017-02-15 15:20:14”} –
即将到来,然后直接你会访问是什么问题? – Sona