What is the function of `chdir()` in PHP and how does it relate to changing the current working directory?

The `chdir()` function in PHP is used to change the current working directory. This function allows you to navigate between different directories within your file system when working with files or directories in your PHP script. By using `chdir()`, you can easily switch to a different directory and perform file operations within that directory.

// Change the current working directory to "new_directory"
chdir("new_directory");