PHP code example of jelix / php-redis

1. Go to this page and download the library: Download jelix/php-redis library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jelix / php-redis example snippets


		# Connecting
		$r = new \PhpRedis\Redis('localhost', 6379);
		
		# Save some value
		$r->some_key = 'hello world';
		
		# Outputting it
		echo $r->some_key;
		
		# Call any redis method (including methods added in redis 2.*)
		echo $r->zcard('zkey');