SplFileInfo::getType

(PHP 5 >= 5.1.2)

SplFileInfo::getTypeGets file type

Beskrivelse

public string SplFileInfo::getType ( void )

Returns the type of the file referenced.

Parametre

This function has no parameters.

Returnerings Værdier

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

Fejl/Undtagelser

Throws a RuntimeException on error.

Eksempler

Eksempel #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

add a note add a note

User Contributed Notes

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