PHP 8.5.0 Beta 1 available for testing

Voting

: max(nine, four)?
(Example: nine)

The Note You're Voting On

tabascopete78 at yahoo dot com
19 years ago
I was using file_get_contents on a set of URLs. Some of them URLs were invalid (the structure of it was ok but the DNS hosts couldn't resolve them) and I kept getting an annoying warning. I wanted to check the DNS somehow but existing check dns function in php doesn't have one for windows and the one a person supplied there does not work 100% of the time.

Instead use this function to try to resolve a host. This won't throw any warnings, you just need to check the output. You'll get the same warnings with fopen and fsockopen.

<< Back to user notes page

To Top