Answers for "php split array into alternating chunks of 1 and 2"

PHP
0

php split array in half

$alphabet = array("a", "b", "c", "d", "e","f");

$firsthalf = array_slice($alphabet, 0, count($alphabet) / 2);
$secondhalf = array_slice($alphabet, count($alphabet) / 2);
Posted by: Guest on October-13-2021

Code answers related to "php split array into alternating chunks of 1 and 2"

Browse Popular Code Answers by Language