- //方法一
- $body ='<img src="image/2009112422220515.gif" alt="php粉丝网Vevb.com" border="0" />';
- preg_match_all("/(src|src)=["|'| ]{0,}(image/(.*).(gif|jpg|jpeg|png|bmp))/isu",$body,$img_array);
- print_r($img_array);
- //方法二
- preg_match_all("/src="(file:///.*?.png)"/i",$body,$a);
- //方法三
- preg_match_all("/<p>.*src="([^^]*?)".*</p>/i",$body,$match);
- print_r($match[1]);
- //方法四
- echo preg_replace('/<imgs+src="(.*)/(.*)">/i','<img src="file/$2">',$body);
新闻热点
疑难解答