In this article, you will learn how to get the real or absolute pathname of the destination in PHP. The realpath() function in PHP returns the absolute pathname. No symbolic link is present in the output.
what is the syntax of the REALPATH function in php?
realpath(path)
Parameter | Description |
---|---|
path | Required. Specifies the path to check |
examples of the REALPATH function
Example 1. In this example, we returns the absolute pathname.
<?php
echo realpath("test.txt");
?>
// Output
C:\Inetpub\testweb\test.txt