change directory in php with function

change directory in php with function

chdir() function is used to change directory in php,it returns true on success and otherwise false.
<?php
//Get current directory
echo getcwd();
echo "<br />";
//Change to the images directory
chdir("test1");
echo "<br />";
echo getcwd();
?>
 if current directory is  C:\test
it will be result
C:\test\test1