PHP 8.5.0 RC 1 available for testing

Voting

: nine minus five?
(Example: nine)

The Note You're Voting On

Kubo2
11 years ago
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);
?>

<< Back to user notes page

To Top