is_readable
判断给定文件名是否可读 (PHP 3, PHP 4, PHP 5) bool is_readable ( string filename )说明
如果由 filename 指定的文件或目录存在并且可读则返回 TRUE。 记住 PHP 也许只能以运行 webserver 的用户名(通常为 'nobody')来访问文件。不计入安全模式的限制。
判断给定文件名是否可读 (PHP 3, PHP 4, PHP 5) bool is_readable ( string filename )说明
如果由 filename 指定的文件或目录存在并且可读则返回 TRUE。 记住 PHP 也许只能以运行 webserver 的用户名(通常为 'nobody')来访问文件。不计入安全模式的限制。
$wurl = 'http://xml.*.com/?p=0023&u=c';
if ($fp = @fopen($wurl, 'r')) {
$content = '';
while ($line = fread($fp, 1024)) {
$content .= $line;
}
}
要加个@要不然页面会有错误。
if ($fp = fopen($wurl, 'r')) {
$content = '';
while ($line = fread($fp, 1024)) {
$content .= $line;
}
}
else exit("unable to open file $wurl");
$xml = simplexml_load_file('http://*.xml')
or die();
...