note 58903 added to function.curl-init
| From: | (e_iad@hotmail.com) | Date: | Sat, 19 Nov 2005 21:38:54 +0000 |
| Subject: | note 58903 added to function.curl-init | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98826@lists.php.net to get a copy of this message | ||
Just if you want to check URL exists on sites server.
<?php
$ch = curl_init("http://ca.php.net/manual/add-note.php");
// use output buffering instead of returntransfer -itmaybebuggy
ob_start();
curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
//Store data
//$retrievedhtml = ob_get_contents();
ob_end_clean();
//200 is meaning valid url as 404 meaning "not found on this server" etc..
if ($info['http_code']==200)
echo "URL is valid<hr>";
else
echo "URL is not valid<hr>";
print_r ($info);
?>
----
Manual Page -- http://www.php.net/manual/en/function.curl-init.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58903
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58903&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58903&report=yes
Search -- http://master.php.net/manage/user-notes.php