(PHP 5 >= 5.1.2, PHP 7)
SplFileInfo::getType — Gets file type
Returns the type of the file referenced.
锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷
A string representing the type of the entry. May be one of file, link, or dir
Throws a RuntimeException on error.
Example #1 SplFileInfo::getType() example
<?php
$info = new SplFileInfo(__FILE__);
echo $info->getType().PHP_EOL;
$info = new SplFileInfo(dirname(__FILE__));
echo $info->getType();
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
file dir