chdir function in php

The chdir() function changes the current directory to the other directory.

chdir() Syntax:
chdir(string $directory) 

chdir example:
<?php
getcwd();//current directory (e.g.c:\project)
chdir("files");//changes to files directory
echo $current_directory=getcwd();
?> 

Output: C:\project\files