x
 
<!DOCTYPE html>
<html>
<body>
<?php
$file = fopen("../demo/php/test.txt","r");
if (is_resource($file)) {
  echo "文件已打开";
} else {
  echo "打开文件时出错";
}
?>
</body>
</html>