This article mainly introduces the usage of the chdir () function in php, and describes how to switch directories using chdir in the form of an instance, for more information about the chdir () function in php, see the example in this article. Share it with you for your reference. The usage analysis is as follows:
Php chdir () function syntax: The bool switches the Directory (string directory) dirDirectory to. Changes current working directory.
Syntax: Boolean switch Directory (string directory) dirDirectory Changes to. Changes current working directory, returns true upon success, returns FALSE if an error occurs.
The sample code is as follows:
The code is as follows:
<? Php
If (chdir ("upload ")){
Print "Changed current directory successfully ";
} // Output: Changed current directory successfully
?>
I hope this article will help you with php programming.