Copyright © tutorialspoint.com
bool chdir ( string $directory ) |
Changes PHP's current directory to the passed directory.
| Parameter | Description |
|---|---|
| directory | Required. The new current directory |
Returns TRUE on success or FALSE on failure.
Following is the usage of this function:
<?php
// current directory
echo getcwd() . "\n";
chdir('html');
// current directory
echo getcwd() . "\n";
?>
|
This will produce following result:
/home/tutorialspoint /home/tutorialspoint/html |
Copyright © tutorialspoint.com