PHP code example of tuupola / beeper

1. Go to this page and download the library: Download tuupola/beeper 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/ */

    

tuupola / beeper example snippets


use Beeper\Adapter\ArrayAdapter;
use Beeper\Beeper;

$array = range(1, 12, 1);
$adapter = new ArrayAdapter($array);

$beeper = new Beeper(["adapter" => $adapter, "size" => 5, "page" => 1]);

foreach ($beeper as $key => $page) {
    print_r($page);
}

$beeper->rewind();
$beeper->next();
$beeper->next();

print_r($beeper->get());