SplFileInfo::getType

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::getTypeGets file type

˵��

public SplFileInfo::getType ( void ) : string

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