note 85188 deleted from function.parse-url by felipe

From: Date: Wed, 20 Aug 2008 02:47:17 +0000
Subject: note 85188 deleted from function.parse-url by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-143655@lists.php.net to get a copy of this message
Note Submitter: Avee ---- I made a bit of code that sees whether a file served via RTSP is there or not: <?php function rtsp_exists($url) { $server = parse_url($url, PHP_URL_HOST); $port = "554"; $hdrs = "DESCRIBE " .$url ." RTSP/1.0"."\r\n\r\n"; //Open connection (15s timeout) $sh = fsockopen($server, $port, $err, $err_otp, 15); //Check connections if(!$sh) return false; //Send headers fputs($sh,$hdrs); //Receive data (1KB) $rtds = fgets($sh, 1024); //Close socket fclose($sh); return strpos($rtds, "200 OK") > 0; } ?>

« previous php.notes (#143655) next »