Get the App
SLTechnology News&Howtos  ›  Development  › 

How php calculates the relative paths of two files

Shulou Source: shulou.com Published: 2022-06-03 19:46:45 11月12日 Update

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:

Tags: Paths two files content more articles nodes good practical subitems subdirectories situations articles methods see knowledge questions references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno Xiaomi Apple MySQL