<?php
$url = "http://www.heroone.com/ems.php";
$r = file_get_contents($url);
//echo $r;//if(preg_match_all("/<TABLE(.*)<\/TABLE>/U",$r,$array))
if(preg_match("/<TABLE style=\"PADDING-LEFT: 8px; LINE-HEIGHT: 23px\" cellSpacing=1 cellPadding=0
width=700 bgColor=#a5d2eb border=0>(.*)<\/TD><\/TR><\/TBODY><\/TABLE>/",$r,$array))
{
echo $array[1]."\n";
}
else
{
echo "Not Found!\n";
}
?> 如上,为什么取不到<TABLE style=\"PADDING-LEFT: 8px; LINE-HEIGHT: 23px\" cellSpacing=1 cellPadding=0
width=700 bgColor=#a5d2eb border=0>(.*)<\/TD><\/TR><\/TBODY><\/TABLE>和<\/TD><\/TR><\/TBODY><\/TABLE>之间的内容?
$url = "http://www.heroone.com/ems.php";
$r = file_get_contents($url);
//echo $r;//if(preg_match_all("/<TABLE(.*)<\/TABLE>/U",$r,$array))
if(preg_match("/<TABLE style=\"PADDING-LEFT: 8px; LINE-HEIGHT: 23px\" cellSpacing=1 cellPadding=0
width=700 bgColor=#a5d2eb border=0>(.*)<\/TD><\/TR><\/TBODY><\/TABLE>/",$r,$array))
{
echo $array[1]."\n";
}
else
{
echo "Not Found!\n";
}
?> 如上,为什么取不到<TABLE style=\"PADDING-LEFT: 8px; LINE-HEIGHT: 23px\" cellSpacing=1 cellPadding=0
width=700 bgColor=#a5d2eb border=0>(.*)<\/TD><\/TR><\/TBODY><\/TABLE>和<\/TD><\/TR><\/TBODY><\/TABLE>之间的内容?
解决方案 »
- smarty中assign的问题
- 问个PHP简单问题
- str_replace的奇怪现象,大家帮帮忙
- 请问各位同仁: IE与火狐下的JS兼容性怎么学习?
- 各位,来讨论一个关于文件夹里存放文件多少与软件查询速度的问题?
- 烦躁死了,报表的图片是怎么出来的啊????请高手给个例子
- php中取子串函数,求位置函数
- 在php中的变量值如何传到javascript中的变量去。代码如何写?
- 关于PHP的调试?我的分没有多少,只给得起50分了?
- 各位大虾,请帮我看看,这是数据库的错还是session的错?
- 在apache中配置PHP,作为Module和作为CGI Binary有什么不同?
- 请教PHP手册上的一些问题
回楼上的再看仔细,有TBODY标签。
$url = "http://www.heroone.com/ems.php";
$r = file_get_contents($url);
//echo $r;
if(preg_match("/<table width=\"700\" border=0 bgcolor=\"#a5d2eb\" cellpadding=\"0\" cellspacing=\"1\" style=\"padding-left:8px; line-height:23px;\">(.*)<\/table>/i",$r,$array))
{
echo $array[1]."\n";
}
else
{
echo "Not Found!\n";
}
$str='<div id="blogname">亮亮的博客<div id="blogTitle">';
preg_match_all("/<div id=\"blogname\">(.*)<div id=\"blogTitle\">/",$str,$arr);
print_r($arr);?>改成这样了还是不行!
preg_match_all("/\<div id=\"blogname\">(.*?)\<div id=\"blogTitle\">/",$str,$arr);
print_r($arr);
<?php
$url = "http://www.heroone.com/ems.php";
$r = file_get_contents($url);
//echo $r;
if(preg_match("/ <table width=\"700\" border=0 bgcolor=\"#a5d2eb\" cellpadding=\"0\" cellspacing=\"1\" style=\"padding-left:8px; line-height:23px;\">(.*) <\/table>/i",$r,$array))
{
echo $array[1]."\n";
}
else
{
echo "Not Found!\n";
} ?>是这一段,哪个有没有没影响
$r = file_get_contents($url); preg_match_all("/\<tr bgcolor=\"#ffffff\" height=\"23\">(.*?)\<\/tr>/", $r, $matches);
var_export(($matches));
preg_match("/<head>(.*)<\/head>/",$r,$array)
取不到内容而
preg_match("/<title>(.*)<\/title>/",$r,$array)
可以取到<title>和</title>之间的内容
var_export(($matches));