I'd like to convert a normal link tag into an image tag,
How would I convert this following,
<a href="images/first.jpg">This is an image.</a>
<a href="images/second.jpg">This is yet another image.</a>
<a href="images/third.jpg">Another image.</a>
Into this with php,
<img src="dir/images/first.jpg">This is an image.
<img src="dir/images/second.jpg">This is yet another image.
<img src="dir/images/third.jpg">Another image.
There can be any number of links in the source.
Thanks.