unknown101 Posted April 26, 2008 Share Posted April 26, 2008 Hello guys, ive got the following snippet of my code..using the snoopy class (which i have double checked outputs the correct results) $fh = fopen($myFile, "r"); $line = fgets($fh); $snoopy->fetchtext("http://www.domain.com"); $source = $snoopy->results; if ( stripos($source, $line) ) echo 'The website grabbed has '. $line .' in it'; else { echo ' The keyword has not been found'; } The code above only works if I manually set the variable $line to a value. For example if i set $line = searchWord, knowing that word is in the website it will find it no problem (and if i deliberately set a word that isnt in the website it will return not found). So this suggests the actual functions works fine. When I read in a line from a txt file and then search for this it doesnt find it?! (As above) I have echo'ed the value which has been read in from the file and it works fine. I can set the a variable to the same as what is read in from the text file and output both values, they appear exactly the same in a browser.. just that the value from the text file will not work in the function?! Does anyone have any idea what could be causing this or if im making a silly mistake? Any suggestions appreciated.. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/103007-still-having-problems-with-stripos/ Share on other sites More sharing options...
unknown101 Posted April 26, 2008 Author Share Posted April 26, 2008 Anyone got any ideas? Still no luck =( Link to comment https://forums.phpfreaks.com/topic/103007-still-having-problems-with-stripos/#findComment-527682 Share on other sites More sharing options...
unknown101 Posted April 27, 2008 Author Share Posted April 27, 2008 Arghh this still isnt working. Has anyone had any problems before just reading a value in from a txt file, assigning to a variable then using it with "Stripos" function ? Link to comment https://forums.phpfreaks.com/topic/103007-still-having-problems-with-stripos/#findComment-528243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.