Manuel PHP
SplFileInfo::getFilename
(PHP 5 >= 5.1.2)
SplFileInfo::getFilename — Gets the filename
Description
public string SplFileInfo::getFilename
( void
)
Gets the filename without any path information.
Liste de paramètres
Cette fonction ne contient aucun paramètre.
Valeurs de retour
The filename.
Exemples
Exemple #1 SplFileInfo::getFilename() example
- <?php
- $info = new SplFileInfo('foo.txt');
- var_dump($info->getFilename());
- $info = new SplFileInfo('/path/to/foo.txt');
- var_dump($info->getFilename());
- $info = new SplFileInfo('http://www.php.net/');
- var_dump($info->getFilename());
- $info = new SplFileInfo('http://www.php.net/anoncvs.php');
- var_dump($info->getFilename());
- ?>
L'exemple ci-dessus va afficher quelque chose de similaire à :
string(7) "foo.txt"
string(7) "foo.txt"
string(0) ""
string(11) "anoncvs.php"
Remonter 
