note 79118 added to function.file-exists

From: Date: Mon, 12 Nov 2007 11:22:04 +0000
Subject: note 79118 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-132201@lists.php.net to get a copy of this message
Older php (v4.x) do not work with get_headers() function. So I made this one and working. <?php function url_exists($url) { // Version 4.x supported $handle = curl_init($url); if (false === $handle) { return false; } curl_setopt($handle, CURLOPT_HEADER, false); curl_setopt($handle, CURLOPT_FAILONERROR, true); // this works curl_setopt($handle, CURLOPT_NOBODY, true); curl_setopt($handle, CURLOPT_RETURNTRANSFER, false); $connectable = curl_exec($handle); curl_close($handle); return $connectable; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 123.49.32.81 ---- Manual Page -- http://www.php.net/manual/en/function.file-exists.php Edit -- https://master.php.net/note/edit/79118 Del: integrated -- https://master.php.net/note/delete/79118/integrated Del: useless -- https://master.php.net/note/delete/79118/useless Del: bad code -- https://master.php.net/note/delete/79118/bad+code Del: spam -- https://master.php.net/note/delete/79118/spam Del: non-english -- https://master.php.net/note/delete/79118/non-english Del: in docs -- https://master.php.net/note/delete/79118/in+docs Del: other reasons-- https://master.php.net/note/delete/79118 Reject -- https://master.php.net/note/reject/79118 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132201) next »