返回由键标识的列表的大小。如果该列表不存在或为空,则命令返回0。如果由Key标识的数据类型不是列表,则命令返回FALSE。

    Parameters:
    string $key
    Returns:
    由键标识的列表的大小存在。如果由键标识的数据类型不是列表,则为FALSE
    Declared in: Redis
    Links: https://redis.io/commands/llen
    Source:
    S:/Software/JetBrains/PHPStorm/App/PhpStorm-2020.2.1.win/plugins/php/lib/php.jar!/stubs/redis/Redis.php
    lLen on redis.io

    1. <?php
    2. //连接本地的 Redis 服务
    3. $redis = new Redis();
    4. $redis->connect('10.1.3.15', 6379);
    5. $redis->auth('kuaicdn_redis_passwd');
    6. $redis->flushAll();
    7. $ret['exec'][]=$redis->rPush('list_test','value1');
    8. $ret['exec'][]=$redis->rPush('list_test','value2');
    9. $ret['exec'][]=$redis->rPush('list_test','value3');
    10. $ret['exec'][]=$redis->rPush('list_test','value4');
    11. $ret['exec'][]=$redis->rPush('list_test','value5');
    12. $ret['cmd']=$redis->lLen('list_test');
    13. $ret['src'][]=$redis->lRange('list_test',0,-1);
    14. print_r($ret);
    15. ?>