What is Directory chdir in PHP
In this article I am going to explain about chdir function in PHP.
PHP chdir() function
The directory chdir function changes the current directory to a specified directory.
Syntax of chdir function
Parameters in chdir function
It has only one parameter:
Parameter |
Description |
directory |
It defines a new directory. |
Example of directory chdir function
<html>
<body>
<?php
echo getcwd(); // it returns current directory
echo "<br/>";
chdir("Dinesh");
echo "<br />";
echo "New directory will be:";
echo "<br/>";
echo getcwd();
?>
</body>
</html>
|
Output:

You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here