What is the best practice for using the basename function in PHP to extract file names?

When using the `basename` function in PHP to extract file names, it is best practice to include the second argument, which specifies a suffix to be stripped from the file name. This ensures that only the base name of the file is returned without any unwanted extensions or path information.

$file_path = "/path/to/file/example.txt";
$file_name = basename($file_path, ".txt");
echo $file_name; // Output: example