$ctx_opts = array('http' => array('timeout' => 10));
$context = stream_context_create($ctx_opts);
$response = file_get_contents($URL, false, $context);
if ($response === false) {
$error_message = error_get_last();
echo $error_message;
}
$context = stream_context_create($ctx_opts);
$response = file_get_contents($URL, false, $context);
if ($response === false) {
$error_message = error_get_last();
echo $error_message;
}
No comments:
Post a Comment