序列化给定 key ,并返回被序列化的值。

    从redis数据库中转储一个键,该值可以稍后通过恢复命令传入redis。数据出来转储是一个二进制表示的关键,因为Redis存储它。

    Parameters:
    string $key
    Returns:
    密钥的Redis编码值,如果密钥不存在,则为FALSE
    Declared in: Redis
    Links: https://redis.io/commands/dump
    Source:
    S:/Software/JetBrains/PHPStorm/App/PhpStorm-2020.2.1.win/plugins/php/lib/php.jar!/stubs/redis/Redis.php
    dump 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('key_test','hello, dumping world!');
    8. $ret['ret'][]=$redis->get('key_test');
    9. $ret['exec'][]=$redis->dump('key_test');
    10. $ret['ret'][]=$redis->get('key_test');
    11. print_r($ret);
    12. ?>

    返回值:

    1. Array
    2. (
    3. [exec] => Array
    4. (
    5. [0] => 1
    6. [1] => hello, dumping world! �cy���
    7. )
    8. [ret] => Array
    9. (
    10. [0] => hello, dumping world!
    11. [1] => hello, dumping world!
    12. )
    13. )