What PHP function can be used to get the file extension from a file path?
To get the file extension from a file path in PHP, you can use the `pathinfo()` function. This function returns an associative array that contains information about a file path, including the file extension. You can then access the file extension using the 'extension' key in the returned array.
$file_path = '/path/to/file/example.txt';
$file_extension = pathinfo($file_path, PATHINFO_EXTENSION);
echo $file_extension; // Outputs 'txt'