ereg and file_get_contents

Iam trying to check if a sting is in a webpage but using ereg is not working, i think its because of the white staces. ie.


$string="PHP is good as long as you know the terminology";

$URL = "http://www.domaintocheck.com";


if(!ereg($string,file_get_contents($URL))) {
echo "String not found"; } else { echo "String found"; }

Is there something else i can use

I have found and tried

if(!preg_quote($string,file_get_contents($URL))) 

It seems to work fine but I have my doubts as there isn’t a lot of feedback regarding this function on PHP.NET can anyone shed some light on it

Sponsor our Newsletter | Privacy Policy | Terms of Service