大佬,Redis如何删除一个GEO地理位置数据??? 我从redis取了几十条数据,加个删除选项删除一条数据,怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>测试工具</title></head><body><form action="" method="get"> Session: <input type="text" name="username"> <br> <input type="submit" value="登录" name="subl"> <div><?php if (isset($_GET['username'])) { header("Content-Type:text/html;charset=utf-8"); $username = $_GET['username']; $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->auth('redis@7yi'); $redis->select(4); $k = $redis->keys('session:' . "*"); if (in_array('session:' . $username, $k)) { echo '你已登录'; $redis->select(2); $redis->geoadd('OrderGeoTree', '121.48012429475784302', '31.23359327436177324', '0'); $redis->geoadd('OrderGeoTree', '0.00000268220901489', '0.00000126736058093', '1'); $redis->geoadd('OrderGeoTree', '117.20841675996780396', '39.11611222593375459', '110'); $redis->geoadd('OrderGeoTree', '128.47578432480124209', '23.48359327436177324', '11'); $redis->geoadd('OrderGeoTree', '29.48012446575784302', '19.23359327773244361', '5'); $it=NULL; $keyArr = $redis->zScan('OrderGeoTree', $it); print_r($keyArr); echo '<hr>';// echo "<tr><td>帮忙</td><td>解决</td></tr>"; for ($i=0; $i < 140; $i++) { $k = $redis->geopos('OrderGeoTree', $i); print_r($i); print_r($k); $v = $i; ?> <form action="" method="get"> <input type="submit" value="删除" name="delid"><!-- --><?php //zRem($v); ?> </form> <?php } } else { echo 'Seesion有误!'; } } else { echo '还未登录!'; } ?></form></body></html><?phpfunction zRem($v){if (isset($v)) { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->auth('redis@7yi'); $redis->select(2); $redis->zRem('OrderGeoTree', $v);}} 悟,貌似突然理解了MVC模型! 求一个去除CSS文件冗余的方法 求一php计算时间的程序 注册的时候,有验证码,但是还是有很多垃圾会员,这是怎么回事? utf-8 截取中文 在windows xp环境下开发的php+mysql+apache网站能应用到linux环境吗? PHP 如何做二级域名 通过判断是星期几,然后再按照是星期几来显示相应的图片 php中网络连接的问题? 关于apc的配置 imagettftext()绝对路径也报错 THINKPHP求助删除原来短信验证码
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>测试工具</title>
</head>
<body>
<form action="" method="get">
Session:
<input type="text" name="username"> <br>
<input type="submit" value="登录" name="subl">
<div><?php
if (isset($_GET['username'])) {
header("Content-Type:text/html;charset=utf-8");
$username = $_GET['username'];
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('redis@7yi'); $redis->select(4);
$k = $redis->keys('session:' . "*"); if (in_array('session:' . $username, $k)) {
echo '你已登录'; $redis->select(2);
$redis->geoadd('OrderGeoTree', '121.48012429475784302', '31.23359327436177324', '0');
$redis->geoadd('OrderGeoTree', '0.00000268220901489', '0.00000126736058093', '1');
$redis->geoadd('OrderGeoTree', '117.20841675996780396', '39.11611222593375459', '110');
$redis->geoadd('OrderGeoTree', '128.47578432480124209', '23.48359327436177324', '11');
$redis->geoadd('OrderGeoTree', '29.48012446575784302', '19.23359327773244361', '5');
$it=NULL;
$keyArr = $redis->zScan('OrderGeoTree', $it);
print_r($keyArr);
echo '<hr>';
// echo "<tr><td>帮忙</td><td>解决</td></tr>";
for ($i=0; $i < 140; $i++) {
$k = $redis->geopos('OrderGeoTree', $i);
print_r($i);
print_r($k); $v = $i;
?>
<form action="" method="get">
<input type="submit" value="删除" name="delid">
<!-- --><?php //zRem($v); ?>
</form>
<?php
}
} else {
echo 'Seesion有误!';
} } else {
echo '还未登录!';
} ?>
</form></body>
</html>
<?php
function zRem($v)
{
if (isset($v)) {
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('redis@7yi'); $redis->select(2);
$redis->zRem('OrderGeoTree', $v);
}
}