PHP Classes

File: timer.php

Recommend this page to a friend!
  Classes of breuls peter   PHP Countdown Timer   timer.php   Download  
File: timer.php
Role: Example script
Content type: text/plain
Description: Date timer
Class: PHP Countdown Timer
Show the time that remains until a given date
Author: By
Last change:
Date: 8 years ago
Size: 1,542 bytes
 

Contents

Class file image Download
<?php

//include class file to your document
   
include 'timeDiff.php';

//activate class
   
$timeDiff = new timeDiff();


//enter args to get started
   
$args = array(
       
'inputFormat' => array(
           
'from' => array(
               
'date' => date('Y-m-d'), //date from where to start 2019-03-29 / date('Y-m-d')
               
'time' => date('H:i:s') //default empty / 23:59:59
           
),
           
'till' => array(
               
'date' => '2016-12-25', //date till where to end
               
'time' => '12:00:00' //default empty / 23:59:59
           
)
        ),
       
'outputFormat' => array(
           
'command' => 'raw'
           
//supported return command
                //raw or empty = return raw usable array
                //rawNoEmpty = return raw usable array with 0 int
                //timer = return a str value, format hours:minutes:seconds
                //days = return a str value, format number of days till end time
           
            //raw supported output data
                //y = years
                //m = months
                //d = days
                //h = hours
                //i = minutes
                //s = seconds
       
)

    );
       
$result = $timeDiff->getDiff($args);
echo
'<pre>';
echo
'the args';
echo
'<br />';
print_r($args);
echo
'<br />';
echo
'the result';
echo
'<br />';
print_r($result);
echo
'</pre>';


?>