SplFileInfo::getType

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::getTypeGets file type

Opis

public SplFileInfo::getType ( void ) : string

Returns the type of the file referenced.

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

A string representing the type of the entry. May be one of file, link, or dir

Błędy/Wyjątki

Throws a RuntimeException on error.

Przykłady

Przykład #1 SplFileInfo::getType() example

<?php

$info 
= new SplFileInfo(__FILE__);
echo 
$info->getType().PHP_EOL;

$info = new SplFileInfo(dirname(__FILE__));
echo 
$info->getType();

?>

Powyższy przykład wyświetli coś podobnego do:

file
dir

add a note add a note

User Contributed Notes

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