Home  >  Article  >  Backend Development  >  PHP怎么只读取一篇文章的文字,不读取图片呢?

PHP怎么只读取一篇文章的文字,不读取图片呢?

WBOY
WBOYOriginal
2016-06-13 12:54:00840browse

PHP如何只读取一篇文章的文字,不读取图片呢?急~
大家好,我在做一个网站,有一篇文章,我要在首页显示这篇文章的文字,但这篇文章中间又有图片,我只要读取前面的240个文字做引导语言,读取240个文字我会,但不知道如何过滤掉图片。
请大家帮帮忙。。。

php 语言
------解决方案--------------------
正则  总之过滤掉图片的html代码即可.
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