Manuel PHP

SplFileInfo::getRealPath

(PHP 5 >= 5.2.2)

SplFileInfo::getRealPathGets absolute path to file

Description

public string SplFileInfo::getRealPath ( void )

This method expands all symbolic links, resolves relative references and returns the real path to the file.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Returns the path to the file.

Exemples

Exemple #1 SplFileInfo::getRealPath() example

  1. <?php
  2. $info = new SplFileInfo('/..//./../../'.__FILE__);  
  3. var_dump($info->getRealPath());  
  4.  
  5. $info = new SplFileInfo('/tmp');  
  6. var_dump($info->getRealPath());  
  7. ?> 

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

string(28) "/private/tmp/phptempfile.php" string(12) "/private/tmp"

Voir aussi


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