title: How to return outer html of DOMDocument?
body: <p>I'm trying to replace video links inside a string - here's my code:</p>
  
  <pre><code>$doc = new DOMDocument();
  $doc-&gt;loadHTML($content);
  foreach ($doc-&gt;getElementsByTagName("a") as $link) 
  {
      $url = $link-&gt;getAttribute("href");
      if(strpos($url, ".flv"))
      {
          echo $link-&gt;outerHTML();
      }
  }
  </code></pre>
  
  <p>Unfortunately, <code>outerHTML</code> doesn't work when I'm trying to get the html code for the full hyperlink like <code>&lt;a href='http://www.myurl.com/video.flv'&gt;&lt;/a&gt;</code></p>
  
  <p>Any ideas how to achieve this?</p>