title: php - get image urls from wordpress posts
body: <p>I have website based on wordpress system and I need to get images urls from every post. I have this code and it's working, but there is problem, because all of posts have same pictures + at the end, there are new ones. Here is example:</p>
  
  <blockquote>
    <p><strong>post1</strong> - image1.png,image2.png,image3.png</p>
    
    <p><strong>post2</strong> - image1.png,image2.png,image3.png,new1.png,new2.png</p>
    
    <p><strong>post3</strong> - image1.png,image2.png,image3.png,new1.png,new2.png,third.png</p>
    
    <p>etc...</p>
  </blockquote>
  
  <p>And here is my php code</p>
  
  <pre><code>preg_match_all('/&lt;img[^&gt;]+&gt;/i',$old_content, $imgTags); 
  
  for ($i = 0; $i &lt; count($imgTags[0]); $i++) {
  
    // get the source string
    preg_match('/src="([^"]+)/i',$imgTags[0][$i], $imgage);
  
    // remove opening 'src=' tag, can`t get the regex right
    $origImageSrc[] = str_ireplace( 'src="', '',  $imgage[0]);
  }
  </code></pre>
  
  <p>Any ideas, why it's doing? :-)</p>