0
我有數組是這樣的:PHP重撥鍵通過模板
$array = array(
array(
'Date' => '2015-10-23',
'Week Day' => 'Friday',
'Hour' => 'asdads',
'Intoduction' => 'adsasdasdasd',
'Call Status' => 'asdadad:',
'Call status options' => 'asdadsad',
'Question 1' => 'asdadads',
'Answer 1' => 'Psdado',
'Question 2' => 'asdadadsasd',
'Answer 2' => 'aasdadasdads',
'Telephone 1' => 'asdadsadsqd',
'Status tel 1' => 'asdasdad'
),
array(
'Date' => '2015-10-23',
'Week Day' => 'Friday',
'Hour' => 'asdads',
'Intoduction' => 'asdadadsasdad',
'Call Status' => "asdadsasdasd",
'Call status options' => 'Busy',
'Telephone 1' => 'asdadsasd',
'Status tel 1' => 'sdasdasdad',
'Question 1' => '',
'Answer 1' => '',
'Question 2' =>'',
'Answer 2' =>''
) ...
);
其他陣列後面,鍵混淆在一起,但它們都具有相同的密鑰。 我想按相同的順序排序所有數組鍵, 缺省情況下,示例爲$ array [0],接下來的$ array [1],$ array [2],...所有按鍵都按$ array排序[0]。
如果輸入數組從頂部,結果應該是:
$array = array(
array(
'Date' => '2015-10-23',
'Week Day' => 'Friday',
'Hour' => 'asdads',
'Intoduction' => 'adsasdasdasd',
'Call Status' => 'asdadad:',
'Call status options' => 'asdadsad',
'Question 1' => 'asdadads',
'Answer 1' => 'Psdado',
'Question 2' => 'asdadadsasd',
'Answer 2' => 'aasdadasdads',
'Telephone 1' => 'asdadsadsqd',
'Status tel 1' => 'asdasdad'
),
array(
'Date' => '2015-10-23',
'Week Day' => 'Friday',
'Hour' => 'asdads',
'Intoduction' => 'asdadadsasdad',
'Call Status' => "asdadsasdasd",
'Call status options' => 'Busy',
'Question 1' => '',
'Answer 1' => '',
'Question 2' =>'',
'Answer 2' =>'',
**'Telephone 1' => 'asdadsasd',
'Status tel 1' => 'sdasdasdad'**
)
);
非常感謝,它的工作原理 – zafirov
太棒了!我很高興我幫助你。 –