PHP realpath() Functie
Definitie en gebruik
De functie realpath() retourneert de absolute padnaam.
Deze functie verwijdert alle symbolische koppelingen (bijvoorbeeld '/./', '/../' en overbodige '/'), en retourneert de absolute padnaam.
Lukt het niet, dan retourneert het false. Bijvoorbeeld als het bestand niet bestaat.
Syntax
readlink(linkpath)
Parameters | Beschrijving |
---|---|
linkpath | Verplicht. Stelt de te controleren pad voor. |
Beschrijving
Op BSD-systemen, als het enkel is linkpath PHP retourneert niet false zoals andere systemen als er niets bestaat.
Voorbeeld
<?php echo realpath("test.txt"); ?>
Uitvoer:
C:\Inetpub\testweb\test.txt