I noticed some similar questions about this problem when I typed the title, but they seem not be in PHP. So what’s the solution to it with a PHP function?
To be specified.
$a="/home/apache/a/a.php";
$b="/home/root/b/b.php";
$relpath = getRelativePath($a,$b); //needed function,should return '../../root/b/b.php'
Any good ideas? Thanks.
Try this one:
This will give
and
and
and