Home  >  Article  >  Backend Development  >  小贝_php+redis门类组合使用

小贝_php+redis门类组合使用

WBOY
WBOYOriginal
2016-06-13 12:23:50913browse

小贝_php+redis类型组合使用

php_redis类型组合使用


一、类型组合说明

       经过前面的文章介绍,已经知道redis有字符串、集合、列表、hash等内置数据类型。

这里以,无序集合为例,进行说明。

集合 set1的简图

       1、从简图中可以看到 set1含有四个元素分别为 A、B、C、D

       2、根据之前的理解,集合的元素为是个单一的类型。一般的都是字符串类型。那么,如果集合的元素是其它的类型呢?如list、hash或是集合呢?redis是否也支持?

      

二、验证类型组合使用

       1、源码例子

       2、例子中,集合type1,存放则一个元素,而且元素是列表类型

       3、验证结果

浏览器进行访问看到

redis终端看到


:

本文档源码下载地址

php_redis中文使用手册

版权声明:本文为博主原创文章,未经博主允许不得转载。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:初来乍到-smartyNext article:crontab定时任务配置记要