我需要一些帮助来尝试两次内爆我的多维数组。我正在使用 Joomla 2.5,它用于后端组件..
这是数组的内容:
Array
(
[jform] => Array
(
[options] => Array
(
[colour] => Array
(
[0] => a
[1] => d
)
[size] => Array
(
[0] => b
[1] => e
)
[qty] => Array
(
[0] => c
[1] => f
)
)
)
)
我尝试使用以下代码:
$i=0;
$optchildArr = array();
$optchildArrX = array();
foreach ($this->options as $optArr) :
$j=0;
foreach ($optArr as $arr) :
$optchildArrX[] = $arr;
$j++;
endforeach;
$optchildArr[$i] = implode(',',$optchildArrX);
$i++;
endforeach;
$this->options = implode(';',$optchildArr);
但我得到了这样的结果:
[options] => Array
(
[0] => a,d
[1] => a,d,b,e
[2] => a,d,b,e,c,f
)
当我追求:
[options] => Array
(
[0] => a,b,c
[1] => d,e,f
)
任何帮助将不胜感激!!:)