relativePath.php
Table of Contents
Functions
- relativePath() : string
- Returns the relative path from a base path to a target path.
Functions
relativePath()
Returns the relative path from a base path to a target path.
relativePath(string $path, string $basePath) : string
Both paths must be of the same type (both absolute or both relative), and must share the same root (e.g., same drive letter on Windows). The result is a canonical relative path.
Parameters
- $path : string
-
The target path.
- $basePath : string
-
The base path.
Tags
Return values
string —The relative path.