Extracting File Information in PHP


Retrieve information about a file, such as its basename, extension, and directory name.

Source Code

$info = pathinfo('/path/to/file.txt');
echo $info['basename'],
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments