Пример #1
0
<?php

$redis = new redis();
$redis->connect('127.0.0.1', 6379);
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
$redis->hset("id:1", "time", "2");
Пример #2
0
 *  Mac 安 装 量
 */
for ($i = 0; $i < count($install); $i++) {
    $mac_arr[] = explode(",", $install[$i]);
}
foreach ($mac_arr as $a => $b) {
    if (in_array("安装", $b)) {
        $mac[] = $b;
    }
}
foreach ($mac as $k => $v) {
    $name[] = substr($v[3], strrpos($v[3], '.'));
    $uname = array_unique($name);
    if (in_array(".exe", $uname)) {
        $re[$v[3]][] = $v;
    }
}
foreach ($re as $k => $v) {
    for ($i = 0; $i < count($v); $i++) {
        $mbr[$k] = count($v);
        $_mbr[] = count($v) . ',' . $k . ',' . $v[$i][1] . ',' . $data;
    }
}
for ($i = 0; $i < count($_mbr); $i++) {
    $_mbr_arr[] = explode(",", $_mbr[$i]);
}
$redis = new redis();
$redis->connect("127.0.0.1", 6379);
foreach ($_mbr_arr as $key => $val) {
    $redis->hset("install", $val[2], json_encode($val));
}