I am trying to find a instance of a string inside another using strpos() but I am having problems.
if(strpos($line, $_GET['search']) !== FALSE){ //does not work
$line is a single line of a text file read in by fgets() and $_GET['search'] is text passed in via the url. This code never gets a match. However same line with $_GET['search'] replaced with straight text works fine.
if(strpos($line, "test") !== FALSE){ //got a match, works
I have tried casting the $_GET variable with strval, and nothing seems to work. Any help would be appreciated. Thanks in advance