Php/docs/splfileinfo.gettype
From Get docs
SplFileInfo::getType
(PHP 5 >= 5.1.2, PHP 7)
SplFileInfo::getType — Gets file type
Description
public SplFileInfo::getType ( ) : string
Returns the type of the file referenced.
Parameters
This function has no parameters.
Return Values
A string representing the type of the entry.
May be one of file
, link
,
or dir
Examples
Example #1 SplFileInfo::getType() example
<?php$info = new SplFileInfo(__FILE__);echo $info->getType().PHP_EOL;$info = new SplFileInfo(dirname(__FILE__));echo $info->getType();?>
The above example will output something similar to:
file dir