Home >Backend Development >PHP Tutorial >Usage of php chdir() function
This article mainly introduces the usage of chdir() function in php. It briefly describes the method of chdir to switch directories in the form of examples. Friends who need it can refer to it
The example in this article describes the usage of the chdir() function in php. Share it with everyone for your reference. The specific usage analysis is as follows:
php chdir() function syntax: bool switch directory ( string directory) dirDirectory changes to.Changes current working directory.
Syntax: bool switch directory (string directory) dirDirectory changes to.Changes current working directory, returns true on success, if an error occurs, returns FALSE.
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 ?>
The above is the detailed content of Usage of php chdir() function. For more information, please follow other related articles on the PHP Chinese website!