How php calculates the relative paths of two files
This article is about how php calculates the relative paths of two files. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Question:
Write a php function to calculate the relative path of the two files. For example, $a = "/ a/b/c/d/e.php"; $b = "/ a/b/12/34/c.php", what is the relative path of B to A?
2. Solution: