Assuming that $text = ea\r\ndad\r\n\r\nedade
My first code:
$text = explode("\r\n",$text);
My new code
function splitNewLine($text) {
$code=preg_replace('/\n$/','',preg_replace('/^\n/','',preg_replace('/[\r\n]+/',"\n",$text)));
return explode("\n",$code);
}
$text = splitNewLine($text);
In both situations, $text
ends up like this:
Array
(
[0] => ea\r\ndad\r\n\r\nedade
)
And I really can't figure why... This is about it, no more code missing and yet it won't work. Any idea on why this happens?