function validatelink($link) { // Create a curl handle to a location $ch = curl_init($link); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_NOBODY, true); if (curl_exec($ch) === false) { echo 'INVALID: ' . $link . " " . curl_error($ch); } else { echo 'VALID: ' . $link; } // Close handle curl_close($ch); }
Example
“;
OP2validatelink(“http://kittell.net.com”);
?>
Last Updated on October 26, 2015