www.webdeveloper.com
Results 1 to 2 of 2

Thread: Searching for a string inside a webpage...

  1. #1
    Join Date
    Aug 2006
    Posts
    103

    Searching for a string inside a webpage...

    How would I search for a string that is on a external webpage using like egrep and curl or something. I then need it to perform an If else function...If found echo "found" else echo "not found"...

    Thanks
    "practice makes perfect, but nobody is perfect so why practice?" -unknown

    "I reject to reality and subsitute my own" - Adam Savage (mythbusters)



    Comment on my pictures!

  2. #2
    Join Date
    Jan 2005
    Posts
    592
    try this one.

    PHP Code:

    $content 
    strip_tags(file_get_contents($URL));

    if (
    strstr($content,$word)) {
       echo 
    'found';
    }
    else {
       echo 
    'not found';


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles