简体   繁体   English

PHP中的Redis:键“ *”

[英]Redis in PHP: keys “*”

I have searched the Internet up and down, but couldn't find the command how to get all keys from Redis db in php. 我已经上下搜索了Internet,但是找不到该命令如何从php中的Redis数据库获取所有密钥。

Example: $redis->connect $redis->hset 示例: $redis->connect $redis->hset $redis->connect $redis->hset

When I type keys "*" in redis-cli, I get all the keys which are stored in db. 当我在redis-cli中键入keys "*"时,我得到了所有存储在db中的键。

Output: 输出:

tenshi@mashiro:~$ redis-cli 127.0.0.1:6379> keys * 1) "Testserver" 2) "testserver" 3) "Server5"

Now I want the similar command in php. 现在我想要在php中类似的命令。

如果您使用PHP扩展程序进行redis ,则命令为$redis->keys('*')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM