Manuel PHP

SplFileInfo::getType

(PHP 5 >= 5.1.2)

SplFileInfo::getTypeGets file type

Description

public string SplFileInfo::getType ( void )

Returns the type of the file referenced.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

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

Erreurs / Exceptions

Throws a RuntimeException on error.

Exemples

Exemple #1 SplFileInfo::getType() example

  1. <?php
  2.  
  3. $info = new SplFileInfo(__FILE__);  
  4. echo $info->getType().PHP_EOL;  
  5.  
  6. $info = new SplFileInfo(dirname(__FILE__));  
  7. echo $info->getType();  
  8.  
  9. ?> 

L'exemple ci-dessus va afficher quelque chose de similaire à :

file dir


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique