Code: Select all
<?php //...
$term = trim($_POST['query']);
$files = glob($dir."./*");
foreach( $files as $key => $value ){
if(preg_match("#".$term."#i", $value))
echo $value."<br>";
} ?>How would i edit it that it only shows the file name, not the directory and the file name? Thanks!