I have a script that has the error-- pathinfo() expects parameter 1 to be string, array given in C:\xampp\htdocs\sitename\index.php on line 4--, how to fix a script is
<?php
$dir = 'dir1/dir2/dir3/dir4/';
$phpfiles = glob($dir ."*.php");
line error ---> $pathinfo= pathinfo($phpfiles, PATHINFO_FILENAME );
foreach ($phpfiles as $phpfile){
echo '<li><a href="'.$phpfile.'">'.$phpfile.'</a></li>';
}
?>