title: Replace link in text to this link with new img tag inside
body: <p>i have some html like this</p>
  
  <pre><code>&lt;span itemprop="actor" itemscope="" itemtype="http://schema.org/Person"&gt;&lt;a rel="nofollow" href="/ru/name/shameik-moore" itemprop="url"&gt;&lt;span itemprop="name"&gt;Шамеик Мур&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>and i need to insert img tag inside link before inner span tag like this</p>
  
  <pre><code>&lt;span itemprop="actor" itemscope="" itemtype="http://schema.org/Person"&gt;&lt;a rel="nofollow" href="/ru/name/shameik-moore" itemprop="url"&gt;&lt;img src="/photo/00/04/20/42074.jpg"&gt;&lt;span itemprop="name"&gt;Шамеик Мур&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>im trying the php code</p>
  
  <pre><code>$img = '&lt;img src="/photo/00/04/20/42074.jpg"&gt;';
  $actor = preg_replace('|(&lt;a.*?&gt;)|', '$1'.$img, $it);
  </code></pre>
  
  <p>but in result i have this</p>
  
  <pre><code>&lt;span itemprop="actor" itemscope="" itemtype="http://schema.org/Person"&gt;&lt;img src="/photo/00/04/20/42074.jpg"&gt;&lt;span itemprop="name"&gt;Шамеик Мур&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>where i lost my first  tag here? )) please help with my reg_replace expression</p>