So lets say I have:
<?php
$template = '<img src="{image}" editable="all image_all" />';
$template .= '<div>';
$template .= '<img src="{image}" editable="yes" />';
$template .= '</div>';
?>
Now what I would like is to make the script go through all the elements containing the {image} src and checking to see if any of them have the
editable="all"
attribute.
If so: get the second editable attribute e.g.
image_all
And include that into the src.
This task can be simplified with the use of a library suggested on comments, Simple HTML DOM Parser:
It is as easy as this: