PHP code example of xiaoyongbrother / redis-message

1. Go to this page and download the library: Download xiaoyongbrother/redis-message 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/ */

    

xiaoyongbrother / redis-message example snippets




$object = new xiaoyongbrother\message\SinglePullMessage('127.0.0.1');
$sender = 'lisi';          //发送者
$to = 'wangwu';            //接收者
$message = 'How are you';  //信息
$time = time();
$arr = array('sender' => $sender, 'message' => $message, 'time' => $time);
echo $object->sendSingle($to, $arr);