去百度提问 老审核不过 所以来来这里问下专业人士 了 希望各位帮我下 谢谢比如 我这个代码是这样的<?php
$a2="&page=18#";
$url = $_GET['url'];
$url1 = $url.$a2;
$lines = file("$url1");
foreach ($lines as $line_num => $line) {
echo "Line <b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>获取了一段网页的html代码
代码中有很多行下列这种 我想要让他把我不需要的过滤了再显示出来Line 173 : <td>15<input type="hidden" id="domain15" value="huoju.icoke.qq.com" /></td>
Line 174 : <td class="blue t_l"><a href="http://huoju.icoke.qq.com" target="_blank">huoju.icoke.qq.com</a></td>
Line 175 : <td class="blue t_l" id="title15">正在获取中……</td>
Line 176 : <td style="text-align:center"><div class="pr-outer"><iframe scrolling="no" frameborder="0" src="http://www.aizhan.com/ajaxAction/getpr.php?from=linkche&domain=huoju.icoke.qq.com&key=9447fdc0b0261a3f32dc50e7b4142ee0" marginwidth="0" marginheight="0" style="border: 0 none" id="prframe"></iframe></div></td> 需要让他只显示比如huoju.icoke.qq.com 这些 取from=linkche&domain=和&key= 中间包含的这些网站 或者<input type="hidden" id="domain15" value=" " /></td> 中包含的网站 就是需要一段php代码来起个过滤作用
$a2="&page=18#";
$url = $_GET['url'];
$url1 = $url.$a2;
$lines = file("$url1");
foreach ($lines as $line_num => $line) {
echo "Line <b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>获取了一段网页的html代码
代码中有很多行下列这种 我想要让他把我不需要的过滤了再显示出来Line 173 : <td>15<input type="hidden" id="domain15" value="huoju.icoke.qq.com" /></td>
Line 174 : <td class="blue t_l"><a href="http://huoju.icoke.qq.com" target="_blank">huoju.icoke.qq.com</a></td>
Line 175 : <td class="blue t_l" id="title15">正在获取中……</td>
Line 176 : <td style="text-align:center"><div class="pr-outer"><iframe scrolling="no" frameborder="0" src="http://www.aizhan.com/ajaxAction/getpr.php?from=linkche&domain=huoju.icoke.qq.com&key=9447fdc0b0261a3f32dc50e7b4142ee0" marginwidth="0" marginheight="0" style="border: 0 none" id="prframe"></iframe></div></td> 需要让他只显示比如huoju.icoke.qq.com 这些 取from=linkche&domain=和&key= 中间包含的这些网站 或者<input type="hidden" id="domain15" value=" " /></td> 中包含的网站 就是需要一段php代码来起个过滤作用
解决方案 »
- 大量数据生成静态HTML的问题
- An error has occurred when creating this preference page.
- 网站地址带中文打不开 怎么解决哦
- What's wrong of my php5+apache2 installation in windows?
- adodb的session是怎么干活的?
- 怎么得不到新增加记录的自动递增字段的值?
- 谁有好一点的聊天室? 能不能给一个给我?
- 登陆问题
- 关于类的一些问题
- SESSION变量为多少个最好?如果我一下子注册50个是不是太过分了?
- 如何获取登录后跳转的网址,有点难度!!
- php 错误日志的时间与系统时间差八小时
$str = <<<html
Line 173 : <td>15<input type="hidden" id="domain15" value="huoju.icoke.qq.com" /></td>
Line 174 : <td class="blue t_l"><a href="http://huoju.icoke.qq.com" target="_blank">huoju.icoke.qq.com</a></td>
Line 175 : <td class="blue t_l" id="title15">正在获取中……</td>
Line 176 : <td style="text-align:center"><div class="pr-outer"><iframe scrolling="no" frameborder="0" src="http://www.aizhan.com/ajaxAction/getpr.php?from=linkche&domain=huoju.icoke.qq.com&key=9447fdc0b0261a3f32dc50e7b4142ee0" marginwidth="0" marginheight="0" style="border: 0 none" id="prframe"></iframe></div></td>
html;preg_match_all('/\&domain=(.*)\&key=/is', $str, $match);
if (isset($match[1])) {
print_r($match[1]);
}Array
(
[0] => huoju.icoke.qq.com
)
我不懂php 麻烦把我把你这段代码和上面的一起 谢谢
$str.= "Line <b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}preg_match_all('/\&domain=(.*)\&key=/is', $str, $match);
if (isset($match[1])) {
print_r($match[1]);
}