(PHP 5 >= 5.1.2)
SplFileInfo::getType — Gets file type
Returns the type of the file referenced.
Esta função não possui parâmetros.
A string representing the type of the entry. May be one of file, link, or dir
Throws a RuntimeException on error.
Exemplo #1 SplFileInfo::getType() example
<?php
$info = new SplFileInfo(__FILE__);
echo $info->getType().PHP_EOL;
$info = new SplFileInfo(dirname(__FILE__));
echo $info->getType();
?>
O exemplo acima irá imprimir algo similar à:
file dir