可以用$str = preg_replace("/]*href=[^>]*>|]*>/i","",$strhtml); 这段来实现需求,如果想要更多解决方法,可以参看以下的。
1、删除内容中的超链接
2、消除包含特定词的超链接
3、获取超链接文本内容
//方法二
preg_match_all('/check user/i',$string,$matches);
print_r($matches);
//方法三
preg_match_all('/]*>[^/i',$string,$matches);
print_r($matches);
//方法四
preg_match_all('/
print_r($arr);
//方法五
preg_match_all('/
print_r($arr);
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号