ChDir-Change Directory
Describe
Boolean chdir (string $ directory)
Change the directory for the current directory of PHP.
Parameters
Directory
The new current directory
return value
Returns TRUE or false success failure.
Instance
Example of # 1 chdir ()
<?php
Current directory
Echo GETCWD (). "N";
ChDir (' public_html ');
Current directory
Echo GETCWD (). "N";
?>
$path = "C:temp";
ChDir ($path);
GETCWD ()
Gives you "C:temp"
$path = "C:temp";
ChDir ($path);
GETCWD ()
Gives you "C:temp"
To work around this inconsistency
Doing a chdir ('. ') after the chdir always gives back "c:temp"
The example above will output similar to the following:
/Home/Article
/home/text/public_html
Note
Note: If Safe mode is activated, PHP will check whether the directory of the script operation has the same UID (owner) script that is being executed.
See again
GETCWD ()-Get current working directory