Manuel PHP

SplFileInfo::getLinkTarget

(PHP 5 >= 5.2.2)

SplFileInfo::getLinkTargetGets the target of a link

Description

public string SplFileInfo::getLinkTarget ( void )

Gets the target of a filesystem link.

Note: The target may not be the real path on the filesystem. Use SplFileInfo::getRealPath to determine the true path on the filesystem.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Returns the target of the filesystem link.

Erreurs / Exceptions

Throws RuntimeException on error.

Exemples

Exemple #1 SplFileInfo::getLinkTarget() example

  1. <?php
  2. $info = new SplFileInfo('/Users/bbieber/workspace');  
  3. if ($info->isLink()) { 
  4.    var_dump($info->getLinkTarget()); 
  5.    var_dump($info->getRealPath());  
  6. }  
  7. ?> 

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

string(19) "Documents/workspace" string(34) "/Users/bbieber/Documents/workspace"


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