Home >Backend Development >PHP Tutorial >php preg_match_all matches pictures in articles

php preg_match_all matches pictures in articles

WBOY
WBOYOriginal
2016-07-25 08:54:26925browse
  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] => php preg_match_all matches pictures in articles [1] => php preg_match_all matches pictures in articles [2] => php preg_match_all matches pictures in articles ) [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 ) )



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn