Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
 
PREVIOUS NEXT
Tagged: #php #split #array
ADD COMMENT
Topic
Name
3+3 =