Results 1 to 2 of 2

Thread: [RESOLVED] Look For Specific Text In A Webpage

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Resolved [RESOLVED] Look For Specific Text In A Webpage

    Hi guys,

    I need a php script that will look for specific text on a webpage. If the text is there it will echo something, if its not there it will echo something else.

    Hope someone can come up with something

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Re: Look For Specific Text In A Webpage

    Its ok guys, I got it myself:

    Code:
    $link = "http://www.test.com";
    $linkcontents = file_get_contents($link);
    	
    $needle = "1.0.0";
    if (strpos($linkcontents, $needle) == false) {
    echo "String not found";
    } else {
    echo "String found";
    }
    Thanks anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width