← All built-ins / realpath()
realpath()
realpath(string $s): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | possibly relative path |
Return value
Canonical absolute path, or false when it does not exist.
Example
$r = realpath("tests");
echo $r !== false && is_dir($r) ? "resolved" : "missing";resolved