I am trying to get all the image src's and rename the files using this code but it doesnt seem to work.
Any ideas ??
require_once('catalog/controller/forum/simple_html_dom.php');
$test = $data['description'];
$html = str_get_html($test);
foreach($html->find('img') as $element) {
$src = $element->src;
rename($src,$src.".jms");
}
All images files are local and this is an example image tag.
<img alt="Image" src="image/data/attaches/f7ff31f73f6d41f108ef31c01ea69228.png">
So i'm trying to rename the file from that to the same location but by adding .jms to the end. Also i'm not sure how but i want to modify all the image tags in the string so i can put it back modified with the mysql update command. The string $data['description'] contains other html not just image tags. Its varied.