php正则表达式问题 php正则表达式怎样取的“内容”二字 要准确取得class="redarrow"下的 ,其他的都不要取</span>内容<em class="redarrow"></em> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 '内容'二字在 class="redarrow"下?? 还是我看花了眼? <span>xxx</span>信息<em class="kk"></em><span>xxx</span>内容<em class="redarrow"></em>取“内容'二字 正则是神,程序猿嘛!于是你只要告诉他:只要被 > < 包括的就可以了 <?php$str=<<<HTML<span>xxx</span>信息<em class="kk"></em><span>xxx</span>内容<em class="redarrow"></em>HTML;preg_match_all('/([^>]*)(?=<em\s+class="redarrow")/',$str,$matchs);print_r($matchs[1]); 取值很准确但是为何 传递值过去后啊 是 Array 啊?b.php //$tempCn 抓到的内容preg_match('/([^>]*)(?=<em\s+class="redarrow")/',$tempCn,$shuc);ob_start();header("Location:a.php?j=".$shuc[0]);ob_end_flush();?>a.php<?php$sh=$_GET["j"]; echo $sh;?>显示的是 array 我自己写的正则式 虽然取值不准确 但传递过去之后能显示请大神指点迷津 错在哪里了? preg_match('/([^>]*)(?=<em\s+class="redarrow")/',$tempCn,$shuc);print_r($shuc);exit();ob_start();header("Location:a.php?j=".$shuc[0]);ob_end_flush();看到什么? 有多个用preg_match_all 看到这个【 Array ( [0] => 扑街兔M_M [1] => 扑街兔M_M ) 】<?preg_match('/([^>]*)(?=<em\s+class="redarrow")/',$tempCn,$shuc);echo $shuc[1]?>这样改能 看到这个 【 扑街兔M_M 】但重定向 传递回去后 就是空值不懂怎么回事 我抓 <title>标签内的 内容 就可以了 重定向传递也 能显示 应该是 正则式的问题 php正则表达式怎样取的“内容”二字 ??? 不可能吧。你都看到[0] = 扑街兔M_M 了。传[0]的值的话不可能是array啊上完整代码。 php连接不上mysql,但Nvicat可以。 php xPath 解析xml文件 问题 UNION ALL链接多个表查询,怎么知道数据来自哪个表? 一个PHP 数组合并问题,请高手帮忙处理,在线等~~!!! phpMyAdmin配置问题 一个变量解析问题 pHP空间大优惠 我的分不多,但我想送分,我成功的实现的php->html,用类真是方便! 元旦将至,散分以庆之~~ 高分求教,急,在线等待…… AMP是否存在被注入风险? 模拟登录 提交不上帐号 密码就可以 请大神们帮解决一下
<span>xxx</span>内容<em class="redarrow"></em>
取“内容'二字
于是你只要告诉他:只要被 > < 包括的就可以了
$str=<<<HTML
<span>xxx</span>信息<em class="kk"></em>
<span>xxx</span>内容<em class="redarrow"></em>
HTML;preg_match_all('/([^>]*)(?=<em\s+class="redarrow")/',$str,$matchs);
print_r($matchs[1]);
但是为何 传递值过去后啊 是 Array 啊?b.php //$tempCn 抓到的内容preg_match('/([^>]*)(?=<em\s+class="redarrow")/',$tempCn,$shuc);
ob_start();
header("Location:a.php?j=".$shuc[0]);
ob_end_flush();
?>
a.php<?php
$sh=$_GET["j"];
echo $sh;
?>显示的是 array 我自己写的正则式 虽然取值不准确 但传递过去之后能显示
请大神指点迷津 错在哪里了?
print_r($shuc);
exit();
ob_start();
header("Location:a.php?j=".$shuc[0]);
ob_end_flush();
看到什么? 有多个用preg_match_all
preg_match('/([^>]*)(?=<em\s+class="redarrow")/',$tempCn,$shuc);
echo $shuc[1]
?>
这样改能 看到这个 【 扑街兔M_M 】但重定向 传递回去后 就是空值
不懂怎么回事