Answers for "split array php two"

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

Browse Popular Code Answers by Language