Beckham _ php + redis simple instance

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.