Blogger Information
Blog 6
fans 0
comment 0
visits 5224
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
检测文件属性
Pythonxzm
Original
833 people have browsed it
<?php
//可以定义一批文件是否存在
$files = [
   'config.php',
   'img/',
   'uploads/',
];
//定义标志位变量
$flag = true;
foreach($files as  $v){
   echo $v;
   //判断是文件还是文件夹
   if(is_file($v)){
       echo '是一个文件    ';
   }else if(is_dir($v)){
       echo '是一个文件夹    ';
   }
   if(is_readable($v)){
       echo ' 可读';
   }else{
        echo '<font color="red">不可读</font>';
   }
   if(is_writeable($v)){
       echo '可写';
   }else{
       echo '<font color="red">不可写</font>';
   }
   echo '<br />';
}
if($flag){
   echo '<a href="step1">下一步</a>';
}else{
    echo '不能进行安装';
}
?>

QQ截图20170924142521.png

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post