php switch 多层 求优
发布网友
发布时间:2022-05-16 03:18
我来回答
共1个回答
热心网友
时间:2023-10-09 20:15
<?php
$kv = new SaeKV(); // 初始化数据库
$kv->init();
$kvget = $kv->get('wx_emoji');
$c1 = count($kvget) > 0 ? count($kvget) : 1;
if ($c1<8) {
$c2 = count($kvget[$c1]) > 0 ? $count($kvget[$c1]) : 1;
if ($c2 == 3) {
$c3 = count($kvget[$c1][$c2]);
if ($c3<7) {
$kvget[$c1][$c2][] = trim($object->Content);
}else {
$kvget[$c1+1][1][] = trim($object->Content);
}
}else {
$c3 = count($kvget[$c1][$c2]);
if ($c3<8) {
$kvget[$c1][$c2][] = trim($object->Content);
} else {
$kvget[$c1][$c2+1][] = trim($object->Content);
}
}
}
$kv->set('wx_emoji', $kvget);