Source Code:
(back to article)
<?php $regex = '/[\s\r\n]+/'; $string = "This is a string\nwith multiple\r\nline breaks."; $split = preg_split($regex, $string); foreach ($split as $line) { echo $line . PHP_EOL; }
Result:
Report an issue