PHP Classes

File: examples/view/app/module1/models/DaysModel.php

Recommend this page to a friend!
  Packages of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/view/app/module1/models/DaysModel.php   Download  
File: examples/view/app/module1/models/DaysModel.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: 10 years ago
Size: 425 bytes
 

Contents

Class file image Download
<?php

class DaysModel {
    protected $months = array(
                            1 => 'Sunday',
                            2 => 'Monday',
                            3 => 'Tuesday',
                            4 => 'Wednesday',
                            5 => 'Thursday',
                            6 => 'Friday',
                            7 => 'Saturday',
                            );
                            
    function numberToName($number) {
        return isset($this->months[$number]) ? $this->months[$number] : false;
    }

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