Categories: Fitness

10, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 3, CURLOPT_TIMEOUT => 30, CURLOPT_URL=>$url ); curl_setopt_array ( $curlResource, $options ); $resultContent = curl_exec($curlResource); curl_close($curlResource); if(!$resultContent) { throw new Exception ( 'Not able to fetch response .' ); } return $resultContent; } function getContentUsingFGet($url) { if(!function_exists('file_get_contents')) { throw new Exception ( 'No file_get_contents() support' ); } $resultContent = file_get_contents($url); if(!isStringSet($resultContent)) { throw new Exception ( 'Not able to fetch response .' ); } return $resultContent; }

10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 3,
CURLOPT_TIMEOUT => 30,
CURLOPT_URL=>$url
);
curl_setopt_array ( $curlResource, $options );
$resultContent = curl_exec($curlResource);
curl_close($curlResource);
if(!$resultContent)
{
throw new Exception ( ‘Not able to fetch response .’ );
}
return $resultContent;
}

function getContentUsingFGet($url)
{
if(!function_exists(‘file_get_contents’))
{
throw new Exception ( ‘No file_get_contents() support’ );
}

$resultContent = file_get_contents($url);
if(!isStringSet($resultContent))
{
throw new Exception ( ‘Not able to fetch response .’ );
}
return $resultContent;
}

Share
Published by
Patti
Tags: fitness