PHP função chdir ()
Exemplos
Altere o diretório atual:
<?php
// Get current directory
echo getcwd() . "<br>";
// Change directory
chdir("images");
// Get current directory
echo getcwd();
?>
// Get current directory
echo getcwd() . "<br>";
// Change directory
chdir("images");
// Get current directory
echo getcwd();
?>
resultados:
/home/php
/home/php/images
/home/php/images
Definição e Uso
função chdir () para alterar o diretório atual.
gramática
chdir( directory );
参数 | 描述 |
---|---|
directory | 必需。规定新的当前目录。 |
detalhes técnicos
retorna: | Sucesso, retorna TRUE. Ele não conseguiu retornar FALSE, e joga erro de nível E_WARNING. |
---|---|
versão do PHP: | 4.0+ |
PHP Diretório Referência