I have to check if my folder asset/files is empty or not to show a message for create a new file or list all files in my folder.. but my folder is empty and i got the message "You got files"..
<?php
/**
* FileExist
* check files
* @return no
*/
public function fileExist()
{
$open = "../asset/files";
if (scandir($open)) {
echo "`You got files";
print_r(scandir($open));
} else {
echo "You haven't got files";
}
}
?>