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 (4 days ago) RSS 2.0 feedStarStarStarStar 69%Total: 408 This week: 1All time: 6,488 This week: 348Up
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 <contact>
Classes: 14 packages by
Country: Pakistan Pakistan
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:408
This week:1
All time:6,488
This week:348Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:66%StarStarStarStar
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:69%StarStarStarStar
Rank:426