我有这样的代码
$assoc = ['name','lastname','pesel'];
$inputs = ['a', 'a', 'a', 'a', 'b', 'b', 'b', 'b',];
$counter = 0;
$internalcounter = 0;
$zero = 0;
$content = array();
while ($counter < sizeof($inputs))
{
if($internalcounter == sizeof($assoc))
{
$counter++;
$internalcounter = 0;
}
else
{
array_push($content, $inputs[$counter]);
$counter++;
$internalcounter++;
}
}
var_dump($content);
它创建了看起来的数组
`array(6) { [0] => string(1) "a" [1] => string(1) "a" [2] => string(1) "a" [3] => string(1) "b" [4] => string(1) "b" [5] => string(1) "b" }`
但我想创建多维数组
Array ( [0] => Array ( [0] => "a" [1] => "a" [2] => "a" ) [1] => Array ( [0] => "b" [1] => "b" [2] => "b" ) )
如何在 $content 中添加下一个数组?