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啊上完整代码。 菜鸟求教,url传递变量问题。 请教各位大侠关于libchart的问题 php编码问题在线等 为何我的自定义函数只能第一次循环是执行,第二次循环到这个函数就自动退出了?奇怪。 正则表达式的问题 各位老大,请帮我个忙,如何抽取MYSQL数据库其中一个字段中重复的数据. php+mysql 下 update 巨郁闷问题!!!!!!!!!! 这个SQL语句怎么写??? php 基础 ,请指点~~~~、 如何实现php查询某个用户输入的信息,别的用户不能访问? 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 】但重定向 传递回去后 就是空值
不懂怎么回事