PHP - chdir
Trieda
Metóda - chdir
(PHP 4, PHP 5, PHP 7)
This function allows to change the current directory.
Note: When the safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed.
Procedurálne
- function chdir (string $directory) : bool
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $directory | string | Specifies the new current directory. |
Mávratovej hodnoty
Vracia: bool
Returns true on success or false on failure.
Príklady
<?php
// Prints the current directory
echo getcwd() . "\n";
// Changes the directory
chdir("slozka");
// Prints the new directory
echo getcwd();
