It can be used to change the root directory
Example
<?php
chroot(“YOUR-CHROOT-PATH”);
echo getcwd();
?>
Output
/
Example
<?php
chroot(“YOUR-CHROOT-PATH”);
echo getcwd();
?>
Output
/
Example
<?php
echo getcwd() . “<br />”;
chdir(‘../’);
echo getcwd() ;
?>
Output
/var/www/test/date
/var/www/test