?php$p = '/img.*?src=[\'|\"](.+?)[\'|\"].*?/i';preg_match_all($p,$str,$match);print_r($match[1][0]);? img alt="" src="http://usr.im/200x60?bg=3498DBtext=tool.lu" class="img" /结果为:http://usr.im/200x60?bg=3498DBtext=tool.lu img alt=""
<?php $p = '/<img.*?src=[\'|\"](.+?)[\'|\"].*?>/i'; preg_match_all($p,$str,$match); print_r($match[1][0]); ?>
<img alt="" src="http://usr.im/200x60?bg=3498DB&text=tool.lu" class="img" /> 结果为:http://usr.im/200x60?bg=3498DB&text=tool.lu <img alt="" src="http://img.558idc.com/uploadfile/allimg/210630/103322G94-1.jpg" class="img" /> 结果为:http://img.558idc.com/uploadfile/allimg/210630/103322G94-1.jpg