/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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"); } }
Comments
