How to Match Newline with Strpos() in PHP

Posted on April 7, 2019 at 11:12 am

Match newline with strpos() in PHP:

$string = "Hello World
Testing New Line";
 
$findme = "Hello World\r\nTesting";
 
if(strpos($string, $findme) !== false)
{
    echo "String found";
}
else
{
    echo "String not found";
}

Receive updates via email

Other Posts

Updated Posts