Mirakurun Mirakurun - 4 months ago 11x
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('*')