PHP code to extract the first picture on the page as a thumbnail

WBOY
Release: 2016-07-25 08:42:21
Original
927 people have browsed it
  1. $p = '//i';
  2. preg_match_all($ p,$str,$match);
  3. print_r($match[1][0]);
  4. ?>
Copy code

  1. The result is: http://usr .im/200x60?bg=3498DB&text=tool.lu
  2. The result is: http://img.it-home.org/data/attachment/forum/2016pic2/55c877240001291602790279-80-80.jpg
Copy code

The picture shows, the first one, PHP


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template