PHP chdir() Function

PHP chdir() Function


Definition :

In php  chdir() Function is inbuilt function.The chdir() function in PHP used to change PHP’s current directory to new directory path. It takes only a single argument as new directory path.

 

Syntax

     chdir(directory)

Parameter
Parameter Description
directory Required. Specifies the new current directory

Given below example Change the current directory:

Output : 

/var/www/html
/var/www/html/testing_gfg