title: PHP find a remote absolute path
body: <p>I'm having a problem fetching the absolute URL of a remote image. What I'm doing right now is this:</p>
  
  <pre><code>foreach($html-&gt;find('img') as $e){
  $path = parse_url($e-&gt;src, PHP_URL_PATH);
  $absolute = realpath($path);
      if($e-&gt;src==$path){
      echo '&lt;img class="pic" src=' . $absolute . '/&gt;&lt;br/&gt;';
      }
  
  }
  </code></pre>
  
  <p>This code has been written using the simple html dom project. The ideea is that I can't display images with a relative url in the original coding because they are not located on my server.</p>
  
  <p>So does anyone know how to resolve the absolute path of a remote image?</p>