$file = '/path/to/file.txt'; $ext = pathinfo($file, PATHINFO_EXTENSION); echo $ext; // Outputs "txt"This code gets the extension of the file `file.txt` and stores it in the `$ext` variable. The resulting output of the `echo` statement is the string "txt". The package/library that contains this function is the PHP Standard Library, which is included automatically in all installations of PHP.