How to match exact string in a webpage in PHP?

Posted by Karthik on Stack Overflow See other posts from Stack Overflow or by Karthik
Published on 2010-05-03T07:47:19Z Indexed on 2010/05/03 7:58 UTC
Read the original article Hit count: 249

Filed under:
|

We can easily check for a match in a string

if (preg_match("/happy/i", "happy is he who has ")) {
    echo "match found.";
} else {
    echo "match not found.";
}
?>

But how to check for the occurrence of match in a webpage or given a url?

© Stack Overflow or respective owner

Related posts about regex

Related posts about php