我正在一个现有的程序中工作,该程序的功能可以带来比我需要的更多的结果。我试图不重建该功能。我只需要将数组缩减到可用的大小。数组如下所示:
array (size=2)
0 =>
array (size=24)
'event' => '2013-07-22'
'endDate' => '0000-00-00'
'startTime' => '09:00:00'
'endTime' => '09:20:00'
'duration' => '1200'
'recurrtype' => '0'
'recurrspec' =>
'recurrfreq' => '0'
'catid' => '9'
'eid' => '13714'
'title' => 'Physical'
'hometext' => 'CALLING PT # NOT IN SERV.'
'fname' => 'John'
'mname' => ''
'lname' => 'Bass Jr'
'id' => '993'
'pubpid' => '993'
'phone_home' => '555-111-2222'
'phone_cell' => ''
'ufname' => 'Dr'
'umname' => 'B'
'ulname' => 'No'
'uprovider_id' => '2'
'catname' => 'Physical'
1 =>
array (size=24)
'event' => '2013-07-22'
'endDate' => '0000-00-00'
'startTime' => '09:00:00'
'endTime' => '09:20:00'
'duration' => '1200'
'recurrtype' => '0'
'recurrspec' =>
'recurrfreq' => '0'
'catid' => '9'
'eid' => '13717'
'title' => 'Physical'
'hometext' => ''
'fname' => 'James'
'mname' => ''
'lname' => 'Lenny Jr'
'id' => '993'
'pubpid' => '993'
'phone_home' => '555-111-2222'
'phone_cell' => ''
'ufname' => 'Dr'
'umname' => 'B'
'ulname' => 'No'
'uprovider_id' => '2'
'catname' => 'Physical'
我需要的所需数组是这样的:
array (size=2)
0 =>
'event' => '2013-07-22'
'startTime' => '09:00:00'
'fname' => 'John'
'lname' => 'Bass Jr'
'phone_home' => '555-111-2222'
1 =>
'event' => '2013-07-22'
'startTime' => '09:00:00'
'fname' => 'James'
'lname' => 'Lenny Jr'
'phone_home' => '555-111-2222'
我已经在 PHP 手册中搜索了一个可以返回这个数组的函数,但只是看不到如何过滤掉我不需要的键。提前致谢。