Home > Backend Development > PHP Tutorial > 关于一个识别图片和其它文件的问题SegmentFault

关于一个识别图片和其它文件的问题SegmentFault

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:48:29
Original
1098 people have browsed it

<code>字文字文字文字文字文字文字文字文字文字文字
http://www.xxxx.com/22333.png
http://www.dsfad.com/bbccccc.zip
www.baidu.com
http://www.dsfad.com/sdsf.jpg
文字文字文字文字文字文字文字文字文字文字文字文字文字文字
http://www.dsfad.com/aaaaaa.doc
http://www.dsfad.com/bbbbbbbbb.zip
字文字文字文
http://segmentfault.com/q/1010000000261860
字文字文字文
</code>
Copy after login
Copy after login

这里我随便弄一段文章代码,我想先识别图片,凡是图片url, 会自动加<img alt="关于一个识别图片和其它文件的问题SegmentFault" >标签,除了图片外的其它的url,会自动加链接标签<a></a>,如何来实现。识别完,最后再合成文章。

求解决方案。

回复内容:

<code>字文字文字文字文字文字文字文字文字文字文字
http://www.xxxx.com/22333.png
http://www.dsfad.com/bbccccc.zip
www.baidu.com
http://www.dsfad.com/sdsf.jpg
文字文字文字文字文字文字文字文字文字文字文字文字文字文字
http://www.dsfad.com/aaaaaa.doc
http://www.dsfad.com/bbbbbbbbb.zip
字文字文字文
http://segmentfault.com/q/1010000000261860
字文字文字文
</code>
Copy after login
Copy after login

这里我随便弄一段文章代码,我想先识别图片,凡是图片url, 会自动加<img alt="关于一个识别图片和其它文件的问题SegmentFault" >标签,除了图片外的其它的url,会自动加链接标签<a></a>,如何来实现。识别完,最后再合成文章。

求解决方案。

这个你得学正则表达式。

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template