Home > Backend Development > PHP Tutorial > 一个网页的图片名的截取,该怎么处理

一个网页的图片名的截取,该怎么处理

WBOY
Release: 2016-06-13 13:29:26
Original
942 people have browsed it

一个网页的图片名的截取
网页的代码里很多:

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><a href="/index.php/Image:EISL_1.1.6.gif" class="image" title="Image:EISL 1.1.6.gif"><img src="/images/0/04/EISL_1.1.6.gif" alt="Image:EISL 1.1.6.gif"    style="max-width:90%"  style="max-width:90%" longdesc="/index.php/Image:EISL_1.1.6.gif"></a>
<br>
铺砌搅拌的均质池
<br>
<a href="/index.php/Image:EISL_1.1.7.gif" class="image" title="Image:EISL 1.1.7.gif"><img src="/images/d/da/EISL_1.1.7.gif" alt="Image:EISL 1.1.7.gif"    style="max-width:90%"  style="max-width:90%" longdesc="/index.php/Image:EISL_1.1.7.gif"></a>
<br>
穿孔导流槽式均质池
<br>
<a href="/index.php/Image:EISL_1.1.8.gif" class="image" title="Image:EISL 1.1.8.gif"><img src="/images/e/e9/EISL_1.1.8.gif" alt="Image:EISL 1.1.8.gif"    style="max-width:90%"  style="max-width:90%" longdesc="/index.php/Image:EISL_1.1.8.gif"></a>
Copy after login

我现在只需要得到图片名(EISL 1.1.6.gif),该怎么做呢?
用正则截取还是别的什么办法呢?求指导


------解决方案--------------------
$contents = preg_replace('/poweredby_mediawiki_88x31\.png/s','',$contents); //加一步,过滤掉它。
Related labels:
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