PHP code example of greezen / redis-pagination

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

    

greezen / redis-pagination example snippets


$items = array(array('score' => 1, 'value' => 'test'));
$redisPagination = new greezen\RedisPagination($redis);
$redisPagination->setKey('list')->insert($items, 60);

$redisPagination = new greezen\RedisPagination($redis);
$redisPagination->setKey('list')->paginate(1, 20);

$redisPagination->setKey('list')->offset(0)->limit(20)->order('desc')->get()

$redisPagination->setKey('list')->first();
$redisPagination->setKey('list')->last();

$redisPagination = new greezen\RedisPagination($redis);
$redisPagination->setKey('list')->delete();