正则不会 求解决 怎么用正则删除网页的head 和 foot部分页面是生成的 或者有其他方法 删除网页的head 和 foot部分 请赐教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 删除掉<body></body>以外的部分?来个范例. 若是这样:你可以试一下:$string = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml"><head><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" /></head><body>dsgfdg<br /></body><foot> <span style="color:red">dsgfdg</span></foot>';$pattern = '/(<head.*>.*<\/head>)|(<foot.*>.*<\/foot>)/i';print preg_replace($pattern, '', $string); 关于iframe导致网址不变的问题,急求解决~ 经常发现开源代码中很多被PHP5.4抛弃的特性,怎么换PHP版本啊? 使用图片缩放类时的问题(php) php项目中可以放入asp.net文件吗? 求PHP 缩小图片尺寸和大小的函数 求,php视频聊天代码或原理 有人能将这页中的价格提取出来吗? 免费的php空间还有么?哪怕静态也成 如何通过FTP上传文件 OCILong 调用ORACLE9I数据库时出错 PHP问题求解 实现了无限分类,但是想要显示呈现树状图
来个范例.
$pattern = '/(<head.*>.*<\/head>)|(<foot.*>.*<\/foot>)/i';
print preg_replace($pattern, '', $string);