Home > Backend Development > PHP Tutorial > http://www.12306.cn/mormhweb/ php regular filter html hyperlinks

http://www.12306.cn/mormhweb/ php regular filter html hyperlinks

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:39:58
Original
1111 people have browsed it

echo preg_replace("/(?<=href=)([^>]*)(?=>)/i","#", "Hello, click here to take a lookHello, click here to take a look");
?>
Regular: /(?<=href=)([^>]*)(?=>)/
(?<=exp) matches the position after exp
(?=exp) matches the position before exp Position
This regular match matches all characters that are not ">" after href= and before ">"
Example:
Find these characters (url) and replace them with # , you can remove all links in html.

The above introduces the hyperlink of http://www.12306.cn/mormhweb/ php regular filtering html, including the content of http://www.12306.cn/mormhweb/. I hope that friends who are interested in PHP tutorials Helps.

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