change url for website content using php
<p>I want to read the content of web page using php and preview it using iframe in HTML page,I make like this to avoid cross origin problems that avoid me to reach other websites content using javascript.</p>

<p>I want to replace each url in a website content using php, I want to replace all urls for src and href tags in HTML file.</p>

<p>for example I want to replace this </p>

<pre><code>&lt;link rel="stylesheet" href="css/style.css" type="text/css" /&gt;
</code></pre>

<p>to </p>

<pre><code>&lt;link rel="stylesheet" href="http://stackoverflow.com/css/style.css" type="text/css" /&gt;
</code></pre>

<p>and the same for java script files and img and other tags.</p>

<p>Any one can help ?</p>
