title: Preventing warnings from fsockopen
body: <p>I use fsockopen() to connect to multiple servers in a loop.</p>
  
  <p>However some servers are not valid and I get PHP warnings like the one below:</p>
  
  <pre><code>Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found
  </code></pre>
  
  <p>Is there a way to prevent these warnings.</p>
  
  <p>Like checking whether the server is good before trying to fsockopen it?</p>
  
  <p>Or is there another or better solution for this?</p>