Home>Article>Backend Development> Usage of chdir() function in php
chdir()FunctionChange the current directory.
Syntax
chdir(directory);
Parameter directory Required. Specifies the new current directory.
chdir() function example code is as follows:
chdir() function changes the current directory instance code, the code is as follows
"; // 改变目录 chdir("images"); // 获得当前目录 echo getcwd(); ?>
Result:
/home/php /home/php/images
The above is the detailed content of Usage of chdir() function in php. For more information, please follow other related articles on the PHP Chinese website!