<?php
function restructureArray3($array, $x)
{
while ($x)
$return [] = implode(', ', array_splice($array, 0, ceil(sizeof($array) / $x--)));
return $return;
}
$array = range(1, 100);
$x = 3;
echo "" . (ceil(sizeof($array) / 3) . "\n";
var_dump(array_splice($array, 0, ceil(sizeof($array) / 3));
var_dump($array);
- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
- Parse error: syntax error, unexpected ';' in /in/2bOUu on line 15
Process exited with code 255.
preferences:
182.79 ms | 1395 KiB | 58 Q