This doesn\'t work:
$string = \'Hello world\'; if(strpos($string, \'\\n\')) { echo \'New line break found\'; } else { echo \'not found\'; } <
$string = \'Hello world\'; if(strpos($string, \'\\n\')) { echo \'New line break found\'; } else { echo \'not found\'; }
line break is \r\n on windows and on UNIX machines it is \n. so its search for PHP_EOL instead of "\n" for cross-OS compatibility, or search for both "\r\n" and "\n".
\r\n
\n
PHP_EOL