Handling File Paths and Directories in PHP


Use built-in functions to manipulate and retrieve file path components.

Source Code

echo basename('/path/to/myfile.txt'); // Outputs: myfile.txt
echo dirname('/path/to/myfile.txt'); // Outputs: /path/to
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments