Is there an inbuilt way in PHP to parse a string like this: '/path/to/../../up/something.txt'
- by alex
So say I have a string like so of a path
$path = '/path/to/../../up/something.txt';
Is there a way built into PHP to parse it and come up with a URL without the directory ups (../) ?
E.g.
$path = parsePath('/path/to/../../up/something.txt'); // /up/something.txt