publ">
时间:2021-07-01 10:21:17 帮助过:68人阅读
$redis = new Redis(); $redis->connect("127.0.0.1","6379"); $redis->publish('tv1', '22222222'); //发布
$channel = 'tv1'; // channel $redis->subscribe(array('channel'.$channel), 'callback'); function callback($redis, $channel, $message) { var_dump($message); exit; }
正确写法
$channel = 'tv1'; // channel $redis->subscribe(array($channel), 'callback'); function callback($redis, $channel, $message) { var_dump($message); exit; }
是我太粗心了,才导致这样的错误。