匹配指定内容间的正则怎样写? 本帖最后由 sbsbv 于 2012-06-19 18:54:52 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 preg_match('/开始(.*)结束/s',$con,$m);echo $m[1]; [User:root Time:07:54:42 Path:/home/liangdong/php]$ php preg.php 什么都的,乱码患难夫妻,标签#·¥¥%#¥·¥%#%·#《》<a>·#《》</a><div>yytt</div><li>></li>dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt[User:root Time:07:54:42 Path:/home/liangdong/php]$ cat preg.php <?php$content = <<<EOF<html>eeeeeeeee<a>开始</a>什么都的,乱码患难夫妻,标签#·¥¥%#¥·¥%#%·#《》<a>·#《》</a><div>yytt</div><li>></li>dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt<a>结束</a>";</html>EOF;$nmatches = preg_match('/<a>开始<\/a>(.*)<a>结束<\/a>/iUs', $content, $matches);print_r($matches[1]);?> php通过飞信发送短信,飞信api,fetion api 主页经常被改,安全方面的菜鸟,很无助,求帮忙 求助安装apache2.2.13 PHP 上传的问题 php串口通信 关于Discuz论坛的问题 这样的数组怎么排序 win98+apache+php4.06时看到的index.php文件是源代码或提示请下载index.php文件 用PHP上传文件,大于2M时出错,有什么办法避免? 要查出n条满足条件的记录并更新其中某个字段,要考虑并发问题,求在php中实现 正则 关于PHP获取MP3文件总长度时间(在线等待高手指导)
echo $m[1];
dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt
[User:root Time:07:54:42 Path:/home/liangdong/php]$ cat preg.php
<?php
$content = <<<EOF
<html>
eeeeeeeee
<a>开始</a>
什么都的,乱码患难夫妻,标签#·¥¥%#¥·¥%#%·#《》<a>·#《》</a><div>yytt</div><li>></li>
dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt
<a>结束</a>";
</html>
EOF;
$nmatches = preg_match('/<a>开始<\/a>(.*)<a>结束<\/a>/iUs', $content, $matches);
print_r($matches[1]);
?>