title: Reading URL's and parse information
body: <p>I have a txt file with 5000 lines with URL's. WHat i'm trying to do is to open every url to extract every url (that first url have).
  My problem is, the first line the script opens the URL and tell me how many links i have with no problem. But for the rest of the URL's in the file isnt showing anything...the array show something like this:</p>
  
  <pre><code>Array
  (
  )
  Array
  (
  )
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>$homepage = file_get_contents('***mytxt file****');
  
  $pathComponents = explode(",", trim($homepage)); //line breaker
  
  //echo "&lt;pre&gt;";print_r($pathComponents);echo "&lt;/pre&gt;";
  
  $count_nlines = count($pathComponents);
  
  for ($i=0;$i&lt;3;$i++) {
  
  $request_url = $pathComponents[$i];
  //echo $request_url . "&lt;br&gt;";
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $request_url);    // The url to get links from
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // We want to get the respone
  $result = curl_exec($ch);
  
  $regex='|&lt;a.*?href="(.*?)"|';
  preg_match_all($regex,$result,$parts);
  $links=$parts[1];
  
  echo "&lt;pre&gt;";print_r($links);echo "&lt;/pre&gt;";
  
  curl_close($ch);
  }
  </code></pre>
  
  <p>Any ideas?!</p>