标签:foreach echo password reac dem 消息队列 php dex 127.0.0.1
<?php
$redis = new Redis();
$redis->connect(‘127.0.0.1‘,6379);
$password = ‘123456‘;
$redis->auth($password);
$arr = array(‘h‘,‘e‘,‘l‘,‘l‘,‘o‘,‘w‘,‘o‘,‘r‘,‘l‘,‘d‘);
foreach($arr as $k=>$v){
$redis->rpush("mylist",$v);
}
<?php
$redis = new Redis();
$redis->connect(‘127.0.0.1‘,6379);
$password = ‘123456‘;
$redis->auth($password);
//list类型出队操作
$value = $redis->lpop(‘mylist‘);
if($value){
echo "出队的值".$value;
}else{
echo "出队完成";
}
?>
*/1 * * * * root php /wwwroot/workplace/redis/index.php
*/3 * * * * root php /wwwroot/workplace/redis/demo.php
标签:foreach echo password reac dem 消息队列 php dex 127.0.0.1
原文地址:https://www.cnblogs.com/qixidi/p/10202466.html