Answers for "php array split 10"

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
0

php split large text on line breaks into array

#1
$arr=explode("n",$text);

#2
$arr=explode("<br>",nl2br($text));
Posted by: Guest on April-21-2021

Browse Popular Code Answers by Language