Mirakurun Mirakurun - 1 year ago 85
PHP Question

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.



When I type
keys "*"
in redis-cli, I get all the keys which are stored in db.


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

Now I want the similar command in php.


If you're using the PHP extension for redis, then the command is $redis->keys('*')