Change the current directory in PHP

Description

The following code shows how to change the current directory.

Example


//from w ww  .j  a v a  2s.c  o m
<?php
    // Get current directory
    echo getcwd() . "<br>";

    // Change directory
    chdir("images");

    // Get current directory
    echo getcwd();
?>




















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip