djdeeno Posted February 8, 2011 Share Posted February 8, 2011 Hi I have script made that reading , in this example, if the word TRUE is on a other site. Wel this works fine, if its match he wil display it on the page, if not, he gives a message that the word not on that site, so far so good. But if i get the word TRUE from a database or type TRUE and a other word BLAH on the answer.php page, he says that the word TRUE is not there. So how can i make it so that, it doesn't matter what others words there be also or if i get the word TRUE from a database that he said the word TRUE is find on that page? Thanks allot, hope people understand me. <?php if( ini_get( 'allow_url_fopen' ) == '1' ) { $response = file_get_contents( 'http://www.domain.nl/answer.php' ); if( $response !='TRUE' ) { echo "Oke true is not there"; } else { echo "Oke True is there"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/227043-reading-match-word-on-other-site-problem-help/ Share on other sites More sharing options...
sunfighter Posted March 5, 2011 Share Posted March 5, 2011 $response is a string not a word. Your testing for a word. You should be using some string function to break the $response string into words like strstr or strpos or explode to see if true is in the string. Quote Link to comment https://forums.phpfreaks.com/topic/227043-reading-match-word-on-other-site-problem-help/#findComment-1183241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.