1.使用tp自带的redis类链接redis
注意自带的redis类set方法不能存数组除非序列化或json数组
$redis = new \Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello redis');
echo $redis->get('test');
echo $redis->get('name');
注意自带的redis类set方法不能存数组除非序列化或json数组
$redis = new \Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello redis');
echo $redis->get('test');
echo $redis->get('name');