PHP Classes

PHP URL Compare: Compare two URLs and show the differences

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (2 months ago) RSS 2.0 feedStarStarStarStar 62%Total: 410 All time: 6,476 This week: 96Up
Version License PHP version Categories
url-compare 1.9BSD License5.3PHP 5, Text processing
Description 

Author

This class can compare two URLs and show the differences.

It can parse two given URLs and compare them to see if they are different.

The class ignores the order of query parameters so it can determine if the URLs are the same even if the order of the parameters is different.

It returns a string with the details of which parts of the URLs may be different.

Innovation Award
PHP Programming Innovation award nominee
October 2013
Number 5


Prize: One copy of the Zend Studio
Sometimes it is necessary to compare two URLs to determine if they represent the same page.

Comparing the URLs character by character may not be enough to determine if the URLs are different because they may represent the same URL with query parameters order switched.

This class can address that situation by parsing the URLs and comparing the query parameters one by one regardless of their order in the URLs.

Manuel Lemos
Picture of Yasir Siddiqui
  Performance   Level  
Name: Yasir Siddiqui is available for providing paid consulting. Contact Yasir Siddiqui .
Classes: 14 packages by
Country: Pakistan Pakistan
Age: 39
All time rank: 3143 in Pakistan Pakistan
Week rank: 312 Up6 in Pakistan Pakistan Down
Innovation award
Innovation award
Nominee: 8x

Winner: 1x

Details

url-difference ============== This class can calculate difference between two Urls. Generally it is difficult to find differences between two long URLs containing key value pairs. You have to "eye-ball" each URL and find difference especially when two urls have different parameters ordering. See example.php for more details.

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation
Plain text file UrlDiffer.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:410
This week:0
All time:6,476
This week:96Up
 User Ratings  
 
 All time
Utility:81%StarStarStarStarStar
Consistency:81%StarStarStarStarStar
Documentation:62%StarStarStarStar
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:913