php正则表达式替换 所有图片地址
发表于2015-06-15 16:14 | 次阅读 | 0条评论 | 作者:siru90
$imgpath = ' <img src="/uploads/101012/4-101012160S5294.jpg" width="138" height="110"> <img src="/uploads/101012/4-101012160S5294.jpg" width="138" height="110">';
$tmp = preg_replace('/(?<=img src)(\W+)uploads/i', "$1dd/uploads", $imgpath);