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