这篇文章主要介绍了php中操作memcached缓存进行增删改查数据的实现代码,需要的朋友可以参考下
核心代码:
connect("127.0.0.1",11211)){ die('连接失败'); } if($memcache->set('key1',"xian",MEMCACHE_COMPRESSED,60)){ echo 'sucess!'; }//存值,其中xian字符串,也可以为数组,对象,,但不能为资源 $val = $memcache->get('key1');//查询获取值 echo $val; $memcache->replace('key1','beijing',MEMCACHE_COMPRESSED,60);//修改 $memcache->delete('key1');//删除 ?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
