PHP Classes

PathParser: Parse URL or file paths and compute relative paths

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 74%Total: 4,101 All time: 750 This week: 347Up
Version License Categories
pathparser 1.0.0GNU General Publi...Files and Folders, Text processing


This class is capable of parsing absolute or relative URLs or file paths and can compute the relative path to go from a given path to another.

It resolves relative references as /./ or /../, and eliminates consecutive / characters in the input path.

It is an alternative to PHP realpath() function, with two basic differences: it works with real and virtual files, and it returns the path resolved in the same style of the input path. So, if you are parsing a relative path, it will return a resolved relative path, not the absolute path like realpath() function does.

This class can determine the relative path between two files and parse query string to extract the parameter names and values into an array.

Picture of Carlos Reche
Name: Carlos Reche <contact>
Classes: 10 packages by
Country: Brazil Brazil
Age: 40
All time rank: 603 in Brazil Brazil
Week rank: 550 Down43 in Brazil Brazil Down
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file class.pathparser.php Class PathParser class file.
Accessible without login HTML file documentation.htm Doc. Class documentation
Accessible without login Plain text file example.php Example File with examples of how to use PathParser class.

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:750
This week:347Up
 User Ratings  
 All time