I have a html content as listed below.
<img title="" style="float: none;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;" src="http://www.mbatious.com/sites/default/files/imagecache/Large/Distchart.jpg" class="imagecache-Large" alt="">
I would like to replace the empty alt and title text with the name of the image file (Distchart). How to do this using preg_replace in php? After performing replace operation, the html should be like
<img title="Distchart" style="float: none;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;" src="http://www.mbatious.com/sites/default/files/imagecache/Large/Distchart.jpg" class="imagecache-Large" alt="Distchart">