What is Directory chdir in PHP

In this article I am going to explain about chdir function in PHP.
  • 1747

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





echo getcwd(); // it returns current directory

echo "<br/>";


echo "<br />";

echo "New directory will be:";

echo "<br/>";

echo getcwd();






chdir function.jpg

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.