<html>
<head><title>php获取网页里的所有超链接</title></head>
<body>
<a href="./">返回列表</a><br>
<form action="<?php echo $PHP_SELF;?>" method="post">
URL:<input type="text" name="url" value="<?php echo $url?>"><input type="submit" value="获取所有裢接">
</form>
<?php
if(isset($url)){
echo "$url 有下列裢接:<br>";
$fcontents = file($url);
while(list(,$line)=each($fcontents)){
while(eregi((href[[:space:]]*=[[:space:]]*"?[[:alnum:]:@/._-]+"?)(.*),$line,$regs)){
$regs[1] = eregi_replace((href[[:space:]]*=[[:space:]]*"?)([[:alnum:]:@/._-]+)("?),"\2",$regs[1]);
echo " $regs[1]<br>";
$line = $regs[2];
}
}
}
?>
</body>
</html>PHP Parse error: syntax error, unexpected '[' in E:\PHP100.COM\PHPtest\test.php on line 13
环境:IIS6.0 + FastCGI + php版本5.3.8
<head><title>php获取网页里的所有超链接</title></head>
<body>
<a href="./">返回列表</a><br>
<form action="<?php echo $PHP_SELF;?>" method="post">
URL:<input type="text" name="url" value="<?php echo $url?>"><input type="submit" value="获取所有裢接">
</form>
<?php
if(isset($url)){
echo "$url 有下列裢接:<br>";
$fcontents = file($url);
while(list(,$line)=each($fcontents)){
while(eregi((href[[:space:]]*=[[:space:]]*"?[[:alnum:]:@/._-]+"?)(.*),$line,$regs)){
$regs[1] = eregi_replace((href[[:space:]]*=[[:space:]]*"?)([[:alnum:]:@/._-]+)("?),"\2",$regs[1]);
echo " $regs[1]<br>";
$line = $regs[2];
}
}
}
?>
</body>
</html>PHP Parse error: syntax error, unexpected '[' in E:\PHP100.COM\PHPtest\test.php on line 13
环境:IIS6.0 + FastCGI + php版本5.3.8
解决方案 »
- 两个FLOAT相加出现的奇怪现象~~~~
- Ajax 里xmlHttpRequest对象 未定义。
- 那种换衣服的FLASH能否用PHP开发呢?
- php如何实现获取某个网络资源,如 www.g.cn/abc.zip ,有哪些是可变通的,想尝试突破ISA服务器
- mysql郁闷郁闷郁闷
- 新手提问!用什么php技术最适合?
- PHPMailer 报错 Could not instantiate mail function.
- 谁有mantis的数据库sql文件吗??急用,谢拉
- 一个有点难度的问题,不知道php好不好解决,怎么判断一个ip在不在一个网里?130分
- php中javascript怎么处理?
- 关于查询重复记录最高效的方法
- 求php 高手
$regs[1] = eregi_replace((href[[:space:]]*=[[:space:]]*"?)([[:alnum:]:@/._-]+)("?),"\2",$regs[1]);这两行eregi第一个参数是一个字符串,没有用引号包含起来
这个点去了