我有一个数组:
Array
(
[d26f8828-8362-7d78-49db-2abfd44608f7] => 2cdc40f5-3e99-72b2-1bc8-9ec30496106c
[c464b8ff-adfc-b901-1ec3-77f119a896c5] => b79c98de-07ba-9c53-d6a4-2de07eec9537
)
如何将其转换为多维数组,如下所示:
Array
(
[0] => Array
(
[d26f8828-8362-7d78-49db-2abfd44608f7] => 2cdc40f5-3e99-72b2-1bc8-9ec30496106c
)
[1] => Array
(
[c464b8ff-adfc-b901-1ec3-77f119a896c5] => b79c98de-07ba-9c53-d6a4-2de07eec9537
)
)
答案 0 :(得分:1)
$newArray = array();
foreach($array as $key => $value){
$newArray[] = array($key =>value);
}
$newArray
有你需要的东西。