PHP realpath() Function

Definition

This function removes all symbolic links (like '/./', '/../' and extra '/') and returns the absolute pathname.

Syntax

PHP realpath() Function has the following syntax.

realpath(path)

Parameter

ParameterIs RequiredDescription
pathRequired.Path to check

Return

This function returns FALSE on failure.

The realpath() function returns the absolute pathname.

Example

Get the real path for a relative path


<?php
echo realpath("..\..\test.txt");
?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions