匹配一段html中所有的src

1 $content = "html代码";
2 preg_match_all("/(href|src)=(["|']?)([^ "'>]+.(gif|jpg|jpeg|bmp|png))\2/i", $content, $img_array);
3 print_r($img_array);
原文地址:https://www.cnblogs.com/17too/p/4004634.html