Home > php教程 > php手册 > php过滤非本站链接

php过滤非本站链接

WBOY
Release: 2016-06-13 10:03:20
Original
1006 people have browsed it

php教程过滤非本站链接

本文章是一款利用了php正则表达式来过滤非本站的链接实例。
*/
php

$neirong = preg_replace("/]*?[^]*?>).*?/si","",$bbb);
echo $neirong;

 

方法二

$str ='

  • 施华洛世奇!
  • f乔
  • f衣';

    $match='/

  • (.*)
  • /isu';
    preg_match_all($match,$str,$arr);
    echo "
    ";<br>
    print_r($arr[0]);<br>
    echo "
    Copy after login
    ";
    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 Recommendations
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template