Read Current Directory Structure in PHP

Syntax: Read folder structure from root directory :  getcwd();
Output - C:\xampp\htdocs\<YOUR FOLDER DIRECTORY>
Description: <Your Folder Directory with root>

Syntax: Read folder structure from root directory : dirname(__FILE__);
Output - C:\xampp\htdocs\<YOUR FOLDER DIRECTORY>
Description: <Your Folder Directory with root>

Syntax: Red only current folder name :  basename(__DIR__)
& code is in “car-news” directory it will return only car-news
Output: car-news <You’re Folder Directory without root>


No comments :

Post a Comment

Leave A Comment...