downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplFileInfo::isDir> <SplFileInfo::getSize
[edit] Last updated: Fri, 25 May 2012

view this page in

SplFileInfo::getType

(PHP 5 >= 5.1.2)

SplFileInfo::getTypeGets file type

Beschreibung

public string SplFileInfo::getType ( void )

Returns the type of the file referenced.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

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

Fehler/Exceptions

Throws a RuntimeException on error.

Beispiele

Beispiel #1 SplFileInfo::getType() example

<?php

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

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

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

file
dir



add a note add a note User Contributed Notes SplFileInfo::getType
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites