这篇文章主要介绍了关于PHP测试memcached 的方法,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
1.memcached生成key<?php
$nemcache = new memcached;
$memcache -> connetct('192.168.1.10') or die ("Could not connect Memcached Server");
$memcache -> set ('key','Connect Memcached Server sussucfull');
$get = $memcache -> get('key');
echo $get;
?>
2.mecached删除key<?php
$nemcache = new memcached;
$memcache -> connetct('192.168.1.10') or die ("Could not connect Memcached Server");
//$memcache -> set ('key','Connect Memcached Server sussucfull'); //设置
//$memcache -> replace('key','New Connect Memcached Server sussucfull');
$memcache -> delete('key');//删除
$get = $memcache -> get('key');//查询
echo $get;
?>
以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!
相关推荐:
PHP 7.1安装xhprof进行性能分析的介绍
php 如何加入即时推送的功能