I have this img tag
<img src="../img/tmp/pack_mini_5753_.jpg?time=1464793546" alt="" class="imgm img-thumbnail">
I would like to delete the string ?time=1464793546
. I have the time a dynamic variable so 1464793546
will change dependent on time.
I tried this
$image_tag = ImageManager::thumbnail($path_to_image, 'pack_mini_'.$pack_item->id.'_'.$this->context->shop->id.'.jpg', 120);
var_dump($image_tag);
$pattern = '/(\w+)?time=(\d+)/i';
$replacement = '${1}';
$pack_items[$i]['image'] =preg_replace($pattern, $replacement, $image_tag);
var_dump($pack_items[$i]['image']);exit;
$image_tag
returns the img tag
<img src="../img/tmp/pack_mini_5753_.jpg?time=1464793546" alt="" class="imgm img-thumbnail">
Var_dump return null.