将php对象DateTime转换为二维数组中的字符串

将php对象DateTime转换为二维数组中的字符串,php,Php,嗨,我有一个像 Array ( [0] => Array ( [id] => 167 [title] => hhhhh [start] => DateTime Object ( [date] => 2016-05-08 00:00:00.000000 [timezone_type] => 3

嗨,我有一个像

 Array
  (
   [0] => Array
    (
        [id] => 167
        [title] => hhhhh
        [start] => DateTime Object
            (
                [date] => 2016-05-08 00:00:00.000000
                [timezone_type] => 3
                [timezone] => Europe/Berlin
            )

        [end] => DateTime Object
            (
                [date] => 2016-05-10 00:00:00.000000
                [timezone_type] => 3
                [timezone] => Europe/Berlin
            )

    )
我需要输出触摸日期时间对象和时区等,只有日期。我认为我的新数组应该如下所示

Array
(
[0] => Array
    (
        [id] => 167
        [title] => hhhhh
        [start] => 2016-05-08 00:00:00.000000
        [end]=> 2016-06-08 00:00:00000



    )

它是如何工作的

我认为它可以很好地工作:

$result = array();
foreach($fatherArray as $element)
{
    $result[] = array("id"    => $element["id"],
                      "title" => $element["title"],
                      "start" => $element["start"]->date,
                      "end" => $element["end"]->date,);
}
var_dump($result);

我希望它能帮助你。

如果你真的需要的话:
array\u walk($myArray,function(&$value){$value['start']=$value['start']->format('Y-m-dh:I:s.u');$value['end']=$value['end']->format('Y-m-dh:I:s.u')为什么不能处理对象?我使用jquery full calendar,他需要简单的数组格式。DateTime对象有点特殊: