Wednesday, April 14, 2010

how to echo data that we read with file_get_contents

Programmer Question

i want to check remote url's page contents. IF remote site's page content contains string http://yahoo.com set $qqq = YH if not contains $qqq = NOYH. i am not talking about "url of that page" im talking about page content of url



$url = "'".$get['url']."'";
$needle = "http://yahoo.com/";
$contents = file_get_contents($url);
if(stripos($contents, $needle) !== false) {
$qqq = "YH";
}


But it's not working. Can anybody help me with the correct syntax? thanks..



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails