Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

realpath()

Example

Returns the absolute path.

<?php
echo realpath(“test.txt”);
?>

The result of the code above will be:

C:\Inetpub\testweb\test.txt

Definition and Usage

The realpath() function returns the absolute path by resolving all symbolic links, removing instances of ‘/./’, ‘/../’, and extra ‘/’ characters.

Syntax

realpath(path)

Parameter Values

Parameter

Description

path

Required. Specifies the path to be checked.

Technical Details

 

Return Value:

Returns the absolute pathname on success; FALSE on failure.

PHP Version:

4.0+

PHP Changelog:

PHP 5.3:
PHP 5.2.1: