Как найти разрыв строки в php?

Sorry I ain't that good with PHP yet, I tried this to find it and then put each line in an array

$translate="this
is in
multiple
lines";
$lastBreak=0;
$it=array();
$ci=0;
for ($i=1;$i<strlen($translate);$i++) {
    if strchr(substr($translate,$i,$i),"\n") {
        $it[$ci]=substr($translate,$lastBreak+1,$i-1);
        $ci+=1;
        $lastBreak=$i;
    }
}

help?

5
задан Oscar Mederos 12 May 2011 в 03:11
поделиться