echo decoct(fileperms("ch.php")-32768);

解决方案 »

  1.   

    或者
    function gP($f){
    return substr(decoct(fileperms($f)),-3);
    }
    高位是表示文件类别,dir=40 file=100
      

  2.   

    int fileperms ( string filename)
    返回文件的权限----但是不能用于远程文件!!而且,结果会放入缓存在类unix操作系统中返回的(rwxrwxrwx) 的权限
    其中r 值是1,w值是2,x值是4
    返回的数字共有5位(前两位一般都是0)形式是
      0    0     7     4     2
               owner group  world users