NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - chdir

Trieda

Koreň \ Bez triedy

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ázovDátový typPredvolená hodnotaPopis
$directorystring

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();

Súvisiace manuály

        Aktivity