龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php 查看文件的属性

时间:2014-06-23 15:05来源:网络整理 作者:网络 点击:
分享到:
php 查看文件的属性 [代码片段(21行)]
<?php
  $myfile = './test.txt';

  if (is_readable ($myfile)) {
    echo 'The file can be read!', '\n';
  } else {
    echo 'The file cannot be read.', '/n';
  }

  if (is_writable ($myfile)) {
    echo 'The file can be used for writing!', '/n';
  } else {
    echo 'The file cannot be used for writing.', '/n';
  }

  if (is_executable ($myfile)) {
    echo 'The file is executable!', '\n';
  } else {
    echo 'The file is not executable.', '\n';
  }
?>
精彩图集

赞助商链接