正则不会 求解决
怎么用正则删除网页的head 和 foot部分
页面是生成的
或者有其他方法 删除网页的head 和 foot部分 请赐教
------解决方案--------------------
删除掉
$string = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta content="正则不会 求解决 PHP 基础编程" name="Keywords"><meta content="怎么用正则删除网页 head 和 foot部分 页面是生成 或者有其他方法 删除网页 head 和 foot部分 请赐教" name="description"><title>正则不会 求解决 - PHP / 基础编程</title><link href="http://c.csdn.net/bbs/t/5/t5.css" rel="stylesheet" type="text/css">dsgfdg<br><foot><span style="color:red">dsgfdg</span></foot>'; $pattern = '/(<head.>.*)|(<foot.>.*)/i'; print preg_replace($pattern, '', $string); <div class="clear"></div></foot.></head.>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号