I made this piece of code to automatically add an alt-text (using the title) to all the images in the description of my page. By replacing alt="" with alt="TITLE".
The code :
$this->data['description'] = str_replace('alt=""', 'alt="' . $product_info['name'] . '"', html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8'));
It works perfectly but the problem is that all the images in the description already have an alt-text (always different), thus they don't get replaced.
Instead of replacing alt="" it should replace alt="EVERYPOSSIBILITY" with the title.
Hope you can help me out with this problem.