Errors checking and opening a URL using PHP
<p>Here is one script with out any errors</p>

<pre><code>$url="http://yahoo.com";
$file1 = fopen($url, "r");
$content = file_get_contents($url); 


$t_beg = explode('&lt;title&gt;',$content);
$t_end = explode('&lt;/title&gt;',$t_beg[1]);
echo $t_end[0];
</code></pre>

<p>And here is the same script using a look to check multiple urls and getting errors</p>

<pre><code>    for ($j=1;$j&lt;=$i;$j++) {
    if ($x[$j]!=''){

    $t_u = "http:".$x[$j];

    $file2 = fopen($t_u, "r");


        $content2 = file_get_contents($t_u); 
        $t_beg = explode('&lt;title&gt;',$content);
        $t_end = explode('&lt;/title&gt;',$t_beg[1]);
                echo $t_end[0];

     }
  }
</code></pre>

<p>The error is <strong>Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in g:/</strong> </p>

<p>What exactly is wrong here?</p>
