string
Rel2Abs(
string cur_dir,
string rel_path
)
The function Rel2Abs returns path that is relative to the specified directory cur_dir.
Parameters
Parameter | Description |
cur_dir |
Path to directory relative to which the rel_path is specified. |
rel_path |
Relative path. |
Example
<?
echo Rel2Abs("/site/", "/temp/index.php"); // /temp/index.php
echo Rel2Abs("/site/", "temp/index.php"); // /site/temp/index.php
echo Rel2Abs("/site/temp/", "../index.php"); // /site/index.php
echo Rel2Abs("/site/temp/", "../../index.php"); // /index.php
?>