PHP Classes

Simple Enumeration: Implement enumerated types using arrays

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 1,445 All time: 2,710 This week: 310Up
Version License PHP version Categories
enum 1.0BSD License3.0Data types
Description 

Author

This class can be used to implement enumerated types using PHP arrays.

It takes an arrays of strings or numbers to be used as names of the enumerated type entries.

The class can check whether a string or number is one of the possible enumerated values and return the respective enumerated value.

It can also return the number of enumerated values and display those values.

Picture of Ellery Leung
Name: Ellery Leung <contact>
Classes: 6 packages by
Country: Hong Kong Hong Kong

  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file example.php Example Example file
Plain text file SimpleEnum.class.php Class Core class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,445
This week:0
All time:2,710
This week:310Up