Home  >  Article  >  Backend Development  >  Usage of php chdir() function

Usage of php chdir() function

怪我咯
怪我咯Original
2017-07-06 10:25:541897browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn