: This article mainly introduces the simple example of Beckham _ php + redis. if you are interested in the PHP Tutorial, please refer to it. Php + redis simple instance
I. description
Because redis is a c/s architecture, any client that meets the requirements of redis can communicate with redis. Many clients are provided officially.
The development of php in web is obvious to all. So here we will mainly explain how to use php and redis instances.
II. instances
Only the redis string type is used here. Get and set commands are used.
Connect ('1970. 0.0.1 ', 127); $ result = $ redis-> set ('name', 'script kid'); if (! $ Result) {die ('set incorrectly. ');} echo $ redis-> get ('name');?>
Describes the interaction process between php and redis:
1. the redis service must be started. Otherwise, the following operations cannot be performed:
2. php connection to the machine and port used to start the redis service
3. php operates redis based on business logic
Appendix:
Source code
Php_redis Chinese user manual
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces a simple example of Beckham _ php + redis, including some content. I hope my friends who are interested in the PHP Tutorial can help me.