I use fsockopen() to connect to multiple servers in a loop.
However some servers are not valid and I get PHP warnings like the one below:
Warning: fs
Use the error control operator and check the results of fsockopen() to verfiy you have a valid connection.
fsockopen()
$rc = @fsockopen(...); if (is_resource($rc)) { // do work }