9951 explained code solutions for 126 technologies

php-redisRedis scan example

while( $it !== 0 ) {
  foreach ( $redis->scan($it, 't*') as $k) {
    # do something with $k
}ctrl + c
while( $it !== 0 )

we should call scan till returned iterator is not zero


Redis object after connection


scans keys based on specified pattern and returns iterator


sample pattern to search keys (in this case, all keys starting with t)


iterator object