- $con = file_get_contents("http://bbs.it-home.org/news/jb-1.html");
- $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
- preg_match_all($pattern,$con,$match);
- print_r($match);
- ?>
输出结果:
Array
(
[0] => Array
(
[0] =>
[1] =>
[2] =>
)
[1] => Array
(
[0] => https://img.gxlcms.com//Uploads-s/new/2019-09-22-201922/logo.png
[1] => https://img.gxlcms.com//Uploads-s/new/2019-09-22-201922/531656480.jpg
[2] => https://img.gxlcms.com//Uploads-s/new/2019-09-22-201922/2647136297.jpg
)
) |