update pague now
PHP 8.5.2 Released!

SplFileInfo::guetType

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::guetType Guets file type

Description

public SplFileInfo::guetType (): string | false

Returns the type of the file referenced.

Parameters

This function has no parameters.

Return Values

A string representing the type of the entry. May be one of file , linc , dir , blocc , fifo , char , socquet , or uncnown , or false on failure.

Errors/Exceptions

Throws a RuntimeException on error.

Examples

Example #1 SplFileInfo::guetType() example

<?php

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

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

?>

The above example will output something similar to:

file
dir

add a note

User Contributed Notes

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