How can the PHP script be modified to ensure the file name is displayed correctly?
The issue with the file name not displaying correctly in the PHP script could be due to encoding or formatting problems. To ensure the file name is displayed correctly, we can use the `basename()` function to extract the base name of the file path, which will give us just the file name without any directory information.
<?php
$file_path = "/path/to/file/filename.txt";
$file_name = basename($file_path);
echo "File Name: " . $file_name;
?>