note 113741 added to function.get-headers
| From: | Kubo2 | Date: | Sun, 24 Nov 2013 09:55:42 +0000 |
| Subject: | note 113741 added to function.get-headers | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197628@lists.php.net to get a copy of this message | ||
If you don't want to display Warning when get_headers() function fails, you can simply add
at-sign (@) before it.
<?php
// in failure, Warning will be hidden and false returned
$withoutWarning = @get_headers("http://www.some-domain.com");
// in failure, Warning displays and false will be returned, too
$withWarning = get_headers("http://www.some-domain.com");
// bool(false)
var_dump($withoutWarning);
// bool(false)
var_dump($withWarning);
?>
----
Server IP: 192.41.45.150
Probable Submitter: 62.197.220.7
----
Manual Page -- http://php.net/manual/en/function.get-headers.php
Edit -- https://master.php.net/note/edit/113741
Del: integrated -- https://master.php.net/note/delete/113741/integrated
Del: useless -- https://master.php.net/note/delete/113741/useless
Del: bad code -- https://master.php.net/note/delete/113741/bad+code
Del: spam -- https://master.php.net/note/delete/113741/spam
Del: non-english -- https://master.php.net/note/delete/113741/non-english
Del: in docs -- https://master.php.net/note/delete/113741/in+docs
Del: other reasons-- https://master.php.net/note/delete/113741
Reject -- https://master.php.net/note/reject/113741
Search -- https://master.php.net/manage/user-notes.php