Return to Snippet

Revision: 32107
at September 18, 2010 08:25 by Mikushi


Initial Code
<?php
/**
 * Add a message to the chat
 * @param Redis $redis Redis connection handler
 * @param String $message message to add
 * @return void
 */
function addMessage($redis, $message) {
	$redis->lPush("chat", $message);
	if($redis->lLen("chat") > 100) {
		$redis->rPop("chat");
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Chat system example

Initial Tags
php

Initial Language
PHP