获取所有(一个或多个)给定 key 的值。
    返回所有指定键的值。
    对于每个不包含字符串值或不存在的键,将返回特殊值false。正因为如此,手术从未失败过。
    Parameters:
    array
    $array
    Declared in:
    Redis
    Links:
    https://redis.io/commands/mget
    Source:
    S:/Software/JetBrains/PHPStorm/App/PhpStorm-2020.2.1.win/plugins/php/lib/php.jar!/stubs/redis/Redis.php
    mget 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->set('list_test1','value1');
    8. $ret['exec'][]=$redis->set('list_test2','value2');
    9. $ret['exec'][]=$redis->set('list_test3','value3');
    10. $ret['exec'][]=$redis->set('list_test4','value4');
    11. $ret['exec'][]=$redis->set('list_test5','value5');
    12. $ret['exec'][]=$redis->set('list_test6','value6',['nx', 'ex' => 10]);
    13. $ret['exec'][]=$redis->set('list_test8','value8');
    14. $ret['ret'][]=$redis->mget(array(
    15. 'list_test5','list_test6','list_test7','list_test8'
    16. ));
    17. print_r($ret);
    18. ?>

    返回值: