Home / PHP Tips Generated By ChatGPT / 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'],