发布时间:2018-02-03 16:43:15 作者:佚名 阅读:(179)
<?php $host = '127.0.0.1'; $port = 11211; $mem = new Memcache(); $mem->connect($host, $port); $items = $mem->getExtendedStats('items'); $items = $items["$host:$port"]['items']; foreach ($items as $key => $values) { $number = $key;; $str = $mem->getExtendedStats("cachedump", $number, 0); $line = $str["$host:$port"]; if (is_array($line) && count($line) > 0) { echo "<table border=2>"; echo "<tr><th>键</th><th>值</th></tr>"; foreach ($line as $key => $value) { echo "<tr>"; echo "<td style='width:30%'>"; echo $key; echo "</td>"; echo "<td style='width: 70%'>"; var_dump($mem->get($key)); echo "</td>"; echo "</tr>"; } echo "</table>"; } }
显示效果:
欢迎分享转载→ 获取memcache缓存下所有的键值对信息_PHP查询Memcache内存中的所有键与值
Vue框架如何与PHP打造前后端分离的管理系统
(0)人喜欢 2023-03-03Deprecated: Methods with the same name as their class will not be constructors
(2975)人喜欢 2022-09-01if condition多个值_thinkphp if标签的condition用法
(3458)人喜欢 2022-08-31PHP获取今日、昨日、上周、本月的起始时间戳和结束时间戳的方法
(64)人喜欢 2019-06-11PHP判断是否是序列化字符串数据的函数
(1469)人喜欢 2015-11-21php数组排序详解
(40)人喜欢 2015-11-21© 2015-2021 - 吾爱编程网 版权所有 苏ICP备18033726号-1关于我们 - 网站声明 - 联系我们