序列化给定 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.phpdump
on redis.io
<?php
//连接本地的 Redis 服务
$redis = new Redis();
$redis->connect('10.1.3.15', 6379);
$redis->auth('kuaicdn_redis_passwd');
$redis->flushAll();
$ret['exec'][]=$redis->set('key_test','hello, dumping world!');
$ret['ret'][]=$redis->get('key_test');
$ret['exec'][]=$redis->dump('key_test');
$ret['ret'][]=$redis->get('key_test');
print_r($ret);
?>
返回值:
Array
(
[exec] => Array
(
[0] => 1
[1] => hello, dumping world! �c�y���
)
[ret] => Array
(
[0] => hello, dumping world!
[1] => hello, dumping world!
)
)