I have a string somethink like
<p><img alt="twerk team" class="pyro-image" src="http://localhost/test/files/thumb/8/595" style="float: none;" /></p>
and what i want to add new string in that
<p><img alt="twerk team" class="pyro-image" src="http://localhost/test/files/thumb/8/595/test_image.jpg" style="float: none;" /></p>
i have tried DOMDocument and Simple HTML parser but not able to do the same. please have a look.
This will append
/test_image.jpgto thesrcof each image element with a class ofpyro-image.Demo
Outputs