标签:channel red head nec header php func ext blog
<?php header(‘content-type:text/html;chaeset=utf-8‘); /** * redis实战 * * 订阅 * * @example php subscribe.php */ //ini_set(‘default_socket_timeout‘, -1); $redis = new \Redis(); $redis->pconnect(‘127.0.0.1‘, 6379); //订阅 echo "订阅msg这个频道,等待消息推送... \n"; $redis->subscribe([‘msg‘], ‘callfun‘); function callfun($redis, $channel, $msg) { print_r([ ‘redis‘ => $redis, ‘channel‘ => $channel, ‘msg‘ => $msg ]); } ?>
标签:channel red head nec header php func ext blog
原文地址:http://www.cnblogs.com/GreenForestQuan/p/7492143.html