Using Class Constants : const « Class « PHP






Using Class Constants

 
<?php 
class Employee { 
    const CATEGORY_WORKER = 0; 
    const CATEGORY_SUPERVISOR = 1; 
    const CATEGORY_MANAGER = 2; 
    
}

?>
  
  








Related examples in the same category

1.Constant definition is considered a static member of the class
2.Counting the elements in an array
3.Finding the size of an array
4.Using Class Constants in PHP5