- var_dump: documentation ( source)
- preg_replace: documentation ( source)
<?php
$img = '<img src="http://ubmcmm.baidustatic.com/media/v1/0f0007MbSXctTD5AG7dqt6.jpg" style="width: 100px; height: 100px;">';
$newImg = preg_replace('/(<img\s+src=[\'|"])(.*?)([\'|"].*>)/','$1aaa.jpg$3',$img);
var_dump($newImg);