Place for some configs

Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.

What is Predis

Flexible and feature-complete PHP client library for Redis
http://wiki.github.com/nrk/predis

Examples of Predis PHP Library for REDIS

Connect

$predis = new Predis\Client(array( 'host' => '127.0.0.1', 'port' => 6379, 'database' => 0 ));

Set Data

$predis->set('key', 'this is data to save'); $predis->set('anotherkey','this is more data to save');

Set Data and Expire after a day

$predis->set('key', 'this is data to save'); $predis->expire('key',86400); $redis->set('anotherkey','this is more data to save'); $predis->expire('anotherkey',86400);

Get Data

$key = $predis->get('key'); $anotherkey = $predis->get('anotherkey');

Get Keys

$keys=$predis->keys('*') $firstkey=$keys[0];

Set multiple keys

$predis->mset('key1','one','key2','two');

Get multiple keys

$all=$predis->mget('key1','key2'); $key1=$all[0]; $key2=$all[1];

Set hash keys with multiple values

$predis->hmset('massachusetts','capital','boston','population','6,587,536','width','183 miles','length','113 miles'); $predis->hmset('vermont','capital','montpelier','population','626,431','width','80 miles','length','160 miles');

Get one value from hash key

$capital=$predis->hmget("vermont","capital"); print "The capital of vermont is ".$capital."\n";

Get all values from hash key

$data=$predis->hmgetall("vermont"); print "The capital of vermont is ".$data["capital"]."\n";