-1
I would like to know how to add the site url in front of the existing src of all images of an example string:
<img src="images/teste.jpg" border="0" width="486" height="370" style="margin: 5px; float: left;" />
<img src="images/teste2.jpg">
for:
<img src="www.meusite.com/images/teste.jpg" border="0" width="486" height="370" style="margin: 5px; float: left;" />
<img src="www.meusite.com/images/teste2.jpg">
What regular expression can I use for this?
It is not good for you to do this in time of execution, because it will fall a lot. Try creating a URL_IMG constant with the site address, then along with the editing tool replace <img src=" with <img src="<?= URL_IMG ? > I think this will revolve.
– user6406
The problem is that I only have a string with html, I need to change on top of the string, because I am building a service.
– henriquedpereira
This img src comes from some string?
– Sr. André Baill