how to get file type in php code example Example: php get filetype <?php echo filetype('/etc/passwd'); // file echo filetype('/etc/'); // dir ?>