PHP Doku:: Gets the target of a link - splfileinfo.getlinktarget.html

Verlauf / Chronik / History: (7) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)DateibehandlungThe SplFileInfo classSplFileInfo::getLinkTarget

Ein Service von Reinhard Neidl - Webprogrammierung.

The SplFileInfo class

<<SplFileInfo::getInode

SplFileInfo::getMTime>>

SplFileInfo::getLinkTarget

(PHP 5 >= 5.2.2)

SplFileInfo::getLinkTargetGets the target of a link

Beschreibung

public string SplFileInfo::getLinkTarget ( void )

Gets the target of a filesystem link.

Hinweis:

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

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns the target of the filesystem link.

Fehler/Exceptions

Throws RuntimeException on error.

Beispiele

Beispiel #1 SplFileInfo::getLinkTarget() example

<?php
$info 
= new SplFileInfo('/Users/bbieber/workspace');
if (
$info->isLink()) {
    
var_dump($info->getLinkTarget());
    
var_dump($info->getRealPath());
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)