PHP code example of itvisionsy / counter

1. Go to this page and download the library: Download itvisionsy/counter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itvisionsy / counter example snippets


$workHoursLog = [
    '2016-01-01'=>10,
    '2016-01-02'=>10,
    '2016-01-03'=>8,
    //...
];

<table>
 foreach($workHours as $date=>$hours): 

\ItvisionSy\Counter\Counter::nextOrInit($counter,[$start=0,[$step=1]]);


//initiate
$counter = new Counter(0,1); 
//OR
Counter::nextOrInit($counter, 0, 1);

// get current value
echo $counter; 
//OR
echo $counter(); 
//OR
echo $counter->current();

//next step
$counter->next();
//OR
$counter(true);