chdir
(PHP 3, PHP 4 , PHP 5)
chdir -- Change directory
Description
bool
chdir ( string directory )
Changes PHP's current directory to
directory. 成功回傳TRUE失敗回傳FALSE。
範例 1. chdir() example
<?php
// current directory echo getcwd() . "\n";
chdir('public_html');
// current directory echo getcwd() . "\n";
?>
|
The above example will output: /home/vincent
/home/vincent/public_html |
|
注: 當安全模式開啟,PHP會檢查執行的腳本和要操作的檔案或目錄是否有相同的UID(擁有者)
See also getcwd().