- var_dump: documentation ( source)
- strpos: documentation ( source)
<?php
$text = <<<TEXT
This is just some text, with
something in the middle
that has newlines around it.
TEXT;
$result = strpos($text, "\nsomething in the middle");
echo 'This works: '; var_dump($result);
echo "\n<br>\n";
$buggy_result = strpos($text, "something in the middle\r");
echo 'This does not: '; var_dump($buggy_result);