逝去的青春
php删除/替换,html/string中的href/anchor/link,使用preg_replace的正则表达式
2012-12-16 jao
替换html的href中所有anchor




1 /*






2  * DO NOT USE THE PATTERN STRING DIRECTLY IN 'preg_match()' !!!!






3  *






4  */






5 $pattern '/(?<=href\=")[^]]+?(?=")/';






6 $replacedHrefHtml = preg_replace($pattern$replacement$html);






7