匹配指定内容间的正则怎样写? 本帖最后由 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]);?> 新手求解include_path问题? php判断$_GET[],没有想象中的简单。大家来看看。 阅览统计量的问题 问一个最菜的问题 Thinkphp中关于$this->redirect()用法 cakephp.acl权限控制,求助~~ 求助高手:怎样取得当前页面的request值 关于远程影射的读取文件的一个问题 请看这条SQL语句 PHP Sql Server存储过程循环问题 正则 关于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]);
?>