I got from a json feed this :
<img src = "http://produits-lemieux.com/produits/bainmoussant_hg.jpg" ></img>
i need to inject alt=""
into the string
Best method to do that in php ?
I got from a json feed this :
<img src = "http://produits-lemieux.com/produits/bainmoussant_hg.jpg" ></img>
i need to inject alt=""
into the string
Best method to do that in php ?
string = '<img src = "http://produits-lemieux.com/produits/bainmoussant_hg.jpg" ></img>';
str_replace('></img>', 'alt=""></img>', $string);
Not sure why you have </img>
when you can just do: alt="" />