Heim  >  Artikel  >  Backend-Entwicklung  >  php preg_match_all匹配文章中图片

php preg_match_all匹配文章中图片

WBOY
WBOYOriginal
2016-07-25 08:54:26865Durchsuche
  1. $con = file_get_contents("http://bbs.it-home.org/news/jb-1.html");
  2. $pattern="//";
  3. preg_match_all($pattern,$con,$match);
  4. print_r($match);
  5. ?>
复制代码

输出结果: Array ( [0] => Array ( [0] => 脚本学堂 [1] => 程序员之家上线了2 [2] => 875EA1C00E50B4542797E24FA6E7E1F2.jpg ) [1] => Array ( [0] => http://bbs.it-home.org/usr/themes/dddefault/images/logo.png [1] => http://bbs.it-home.org/usr/uploads/2012/09/531656480.jpg [2] => http://bbs.it-home.org/usr/uploads/2012/09/2647136297.jpg ) )



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn