title: How to replace spaces with %20 in <img> tags
body: <p>I would like to replace all spaces in the image tags of a html text.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;img src="photo 1.jpg" /&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;img src="photo%201.jpg"/&gt;
  </code></pre>
  
  <p>I didn't find a soultion with preg_replace, but it may be a simple regexp line. 
  Thanks!</p>
  
  <p><strong>Edit</strong>: Sorry guys, my description was not very clear. So, I have a <strong>full html page</strong> and I only want to replace inside the img tags. I can't use urlencode here as it encodes the other stuff as well.</p>