(PHP 5 >= 5.1.2, PHP 7, PHP 8)
SplFileInfo::getType — Gets file type
Questa funzione non contiene parametri.
A string representing the type of the entry.
May be one of file
, link
,
dir
, block
, fifo
,
char
, socket
, or unknown
, or false
on failure.
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();
?>
Il precedente esempio visualizzerĂ qualcosa simile a:
file dir