Is there a way to convert a web URL in to the absolute file system path (independent from OS)?
For example: I have an URL /images/test.jpg (http://www.example.com/images/test.jpg) and I need to get:
- `c:\path\to\webroot\images\test.jpg“ on Windows,
/var/path/to/webroot/images/test.jpgon Linux.
Any way to do this in PHP?
1 Answer