I've a folder on server, m fetching those files but getting some difficulties. my code is
$dir = 'F:\\wamp\www\files';
if (is_dir($dir)) {
if(($file = scandir($dir))!==false) {
foreach ($file as $key => $value) {
$name = substr($value,0,-7);
the scandir() function retuns array of files which returns list of names, i.e.
manoj254.txt
manoj234.txt
pooza145.txt
pooza452.txt
ramesh418.txt
ramesh231.txt
and i've remove the extension by using substr() function after this the output is $name
manoj
manoj
pooza
pooza
ramesh
ramesh
But i need the output $name, without duplicate.i.e
manoj
pooza
ramesh
which means remove duplicates... can any body help me plz !!