PHP Classes

File: examples/view/app/models/MonthsModel.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/view/app/models/MonthsModel.php   Download  
File: examples/view/app/models/MonthsModel.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 534 bytes
 

Contents

Class file image Download
<?php

class MonthsModel {
    protected
$months = array(
                           
1 => 'January',
                           
2 => 'February',
                           
3 => 'March',
                           
4 => 'April',
                           
5 => 'May',
                           
6 => 'June',
                           
7 => 'July',
                           
8 => 'August',
                           
9 => 'September',
                           
10 => 'October',
                           
11 => 'November',
                           
12 => 'December',
                            );
                           
    function
numberToName($number) {
        return isset(
$this->months[$number]) ? $this->months[$number] : false;
    }

    function
nameToNumber($name) {
        return
array_search($name, $this->months);
    }
}