I have this code to search for a string that its both sides has newline but it's not working properly
$pospoint = strpos($pdftxt, "
{$stockcode}
");
It cant find the string if i used above code. Is there other way around this?
I have this code to search for a string that its both sides has newline but it's not working properly
$pospoint = strpos($pdftxt, "
{$stockcode}
");
It cant find the string if i used above code. Is there other way around this?
Use the constant PHP_EOL instead of "
"
.
PHP_EOL (End Of Line) will choose what method the string uses as new line (
,
) so it's more dynamic than just guessing if it's
or
$pospoint = strpos($pdftxt, PHP_EOL.$stockcode.PHP_EOL);