- explode: documentation ( source)
<?php
$app['additional_images']="https://www.google.com/images/srpr/logo11w.png";
$app['product_url']='<a href="http://www.example.com/product.html">The product</a>';
$temp_arr = explode(">",$app['product_url']);
$reconstruct_link_opening_tag=$temp_arr[0].">";
$reconstruct_link_closing_tag="</a>";
// your code.....
if (!empty($app['additional_images'])) echo'<span>'.$reconstruct_link_opening_tag.'<img src="'.$app['additional_images'].'">'.$reconstruct_link_closing_tag.'</span>';