我有一個數組,看起來像這樣:裏面添加元素的元素中關聯數組
array
(
[0] => personA
[1] => personB
)
,我想元素添加到每個人是這樣的:
array
(
[0] => personA
(
[0] => elemA
[1] => elemB
[2] => elemC
)
[1] => personB
)
我用這代碼:
foreach($proj as $key => $cat)
{
$proj[$key] = $this->ReturnFolders(WWW_ROOT . "img/proyectos/" . $cat);
}
即函數返回一個陣列看起來像這樣:
array
(
[0] => elemA
[1] => elemB
)
但顯然不工作,我得到這樣的結果:
array
(
[0] => Array
(
[0] => elemA
[1] => elemB
[2] => elemC
)
[1] => Array
)
「內部元素的元素」?這是一個對象嗎?一個成員變量怎麼樣? – 2014-10-28 15:29:11