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

php过滤非本站链接

WBOY
WBOYOriginal
2016-06-13 10:03:201014browse

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 "
    ";
    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