php 相關係統函數_PHP教程

來源:互聯網
上載者:User
get_current_user () 擷取當前PHP指令碼的所有者的名稱

substr(sprintf("%o",fileperms(getcwd())),-4) 擷取當前檔案/目錄許可權

scandir(getcwd()) 擷取目前的目錄所有檔案/目錄

print_r(posix_getpwuid(10000)); 擷取某uid使用者資訊

chmod("test.txt",0777); 修改指定檔案 或目錄許可權

fileowner() 函數返迴文件的所有者。
php_uname() 擷取系統類別型及版本
getmyuid() 擷取PHP指令碼頁面所有者的UID號碼

print_r (ini_get_all()); 擷取所有配置選項

print_r (php_ini_scanned_files()); 返回設定檔目錄下的設定檔列表

$uid = @posix_getpwuid(@posix_geteuid()); 擷取當前用UID 資訊
$gid = @posix_getgrgid(@posix_getegid()); 擷取當前組GID 資訊
$user = $uid['name']; 提取使用者資訊數組中 name
$uid = $uid['uid']; 提取目前使用者資訊數組中 uid
$group = $gid['name']; 提取當前組資訊數組中 name
$gid = $gid['gid']; 提取當前組資訊中 gid

摘自:lostwolf's Blog

http://www.bkjia.com/PHPjc/478597.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478597.htmlTechArticleget_current_user () 擷取當前PHP指令碼的所有者的名稱 substr(sprintf(%o,fileperms(getcwd())),-4) 擷取當前檔案/目錄許可權 scandir(getcwd()) 擷取目前的目錄所有...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.