PHP Classes

Number Sequence: Format an array of numbers as a sequence or ranges

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 266 All time: 7,758 This week: 206Up
Version License PHP version Categories
numbersequence 1.1Freeware5.0PHP 5
Description 

Author

This is a very simple class that can be used to format an array of numbers as a sequence of number ranges.

It takes an array of integer numbers and sorts the array.

The class generates a string that represents sequences of contiguous numbers as ranges with the first and the last sequence number separated by dashes. Non contiguous numbers are separated commas.

For instance, array(1,2,3,5,7,8,9) is transformed in the sequence "1-3, 5, 7-9".

Picture of R.B. Klaassen
Name: R.B. Klaassen <contact>
Classes: 1 package by
Country: The Netherlands The Netherlands
Age: 44
All time rank: 392394 in The Netherlands The Netherlands
Week rank: 298 Up8 in The Netherlands The Netherlands Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example
Plain text file numberSequence.class.php Class numberSequence class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:266
This week:0
All time:7,758
This week:206Up
User Ratings User Comments (2)
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1447
 
Excellent class.
11 years ago (Frank Heinley)
70%StarStarStarStar
This class is just what I needed.
13 years ago (Jerry Haynes)
70%StarStarStarStar