Just set $ limit to 2for two parts of the array. Thanks to Ben James for mentioning:
preg_split("~\n~",$string, 2);
I tested and works great.
Marginal argument:
, , . -1, 0 null " " , PHP, null flags.
:
, :
$fp = strpos($string,"\n");
$arr = new array(substr($string,0,$fp), substr($string,$fp));
, preg_split();:
$fp = strpos($string,"\n");
$arr = preg_split("~\n~",$string,$fp);
preg_split_once() .