Archive

Posts Tagged ‘php fsockopen’

PHP – HOW TO: check if a URL exists or not ?

August 26th, 2008 No comments
PHP – HOW TO: check if a URL exists or not ? 1'st php function (the simplest way): function test_url_file($url) { $res = (($ftest = @fopen($url, 'r')) === false) ? false : @fclose($ftest); return ($res == TRUE) ? 1:0 ; } 2'nd php function, using fsockopen (not so simple) ! function test_url_file2($url) { $addr=parse_url($url); $host=$addr['host']; $path = $addr['path']; $headtxt = ''; if($sock=fsockopen($host,80, $errno, ...
GoCache - ByREV-Cache v1.0 - live served in : 0.416208 sec (gzip)