Jump to content

Help Search a String inside a CURL variable!!


jigen7

Recommended Posts

hi I'm having trouble with this one what i want to do here is that i want to know if a webapge contains the specific string that i've inputted so i do this like this

function search_call($url,$search_criteria){
$size = 0;

$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// grab URL, and return output
$output = curl_exec($ch);

// close curl resource, and free up system resources
curl_close($ch);
echo $output;
if (eregi($search_criteria, $output)) {
    $size = 1;
}

 

the problem here is that sometimes it returns that the string is not found. but when i went to the actual site and use the ctrl+f i'll see that it actually contains the actual string.. anyone have better idea doing this?? thx

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.