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

Usage of chdir() function in php

怪我咯
怪我咯 Original
2017-07-10 15:19:21 1749browse

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!

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