chdir() : Change directory

echo getcwd();
echo "<br>";
echo getcwd();
Output of above code is here
chdir() to change the directory to a different one. This function returns true on success and false on Failure. We have used getcwd() function to get the current directory location.

To change from current directory to one step up directory
echo getcwd();
echo "<br>";
echo getcwd();
As chdir() returns TRUE or FALSE we can use if condition to post message.
echo getcwd();
echo "<br>";
echo getcwd();
echo " Wrong Directory ";

Directory Functions getcwd() : Get current directory scandir(): List files and directories
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer