SplFileInfo::getType

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::getTypeGets file type

설명

public string SplFileInfo::getType ( void )

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

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top