Anonymous
public php v1 · immutablefunction verifica($url) {$url = 'http://'.$url; $ch = curl_init(); $urldata = parse_url($url); $headers = array("Host: 127.0.0.1"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch ,CURLOPT_TIMEOUT, 5); $result = curl_exec ($ch); $x = curl_getinfo($ch); curl_close ($ch); if (in_array('200', $x)) { return 1; } else { return 0; } } }