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,097 This week: 1All time: 749 This week: 182Up
Version License Categories
pathparser 1.0.0GNU General Publi...Files and Folders, Text processing
Description Author

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: 38
All time rank: 603 in Brazil Brazil
Week rank: 185 Down5 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:1
All time:749
This week:182Up
 User Ratings  
 All time
For more information send a message to info at phpclasses dot org.