php - Preventing warnings from fsockopen -
i use fsockopen() connect multiple servers in loop.
however servers not valid , php warnings 1 below:
warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: requested name valid, no data of requested type found
is there way prevent these warnings.
like checking whether server before trying fsockopen it?
or there or better solution this?
use error control operator , check results of fsockopen()
verfiy have valid connection.
$rc = @fsockopen(...); if (is_resource($rc)) { // work }
Comments
Post a Comment