thinkphp5如何使用redis?
1.设置应用配置文件config.php
type可以是很多分类File、Redis等等。
相关推荐:《ThinkPHP教程》
2.thinkphp5使用redis
新建application/index/controller/index.php
set('name','klc123'); $data = $han->get('name'); $this->assign('data',$data); return view(); } }
3.前端显示
新建application/index/view/index.html
输出:
klc123
PS:使用redis,注意开启redis服务器。
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!