PHP chdir function ()
Esempi
Cambiare la directory corrente:
<?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();
?>
risultati:
/home/php
/home/php/images
/home/php/images
Definizione e utilizzo
la funzione chdir () per cambiare la directory corrente.
grammatica
chdir( directory );
参数 | 描述 |
---|---|
directory | 必需。规定新的当前目录。 |
dettagli tecnici
Ritorni: | Successo, restituisce TRUE. Non è riuscito a restituire FALSE, e genera un errore di livello E_WARNING. |
---|---|
versione di PHP: | 4.0+ |
PHP Directory di riferimento