How can PHP be used to display a list of files without showing the full path?
When displaying a list of files using PHP, the full path of each file is often shown by default, which may not be desired for security or aesthetic reasons. To display just the file names without the full path, you can use the `basename()` function in PHP to extract the filename from the full path.
<?php
$directory = "path/to/directory";
$files = scandir($directory);
foreach ($files as $file) {
if ($file != '.' && $file != '..') {
echo basename($file) . "<br>";
}
}
?>