本文整理汇总了PHP中L::vdl方法的典型用法代码示例。如果您正苦于以下问题:PHP L::vdl方法的具体用法?PHP L::vdl怎么用?PHP L::vdl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::vdl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
L::line("Where user is userfoo.", $watch->stop()->result(), ",", $subc->length(), "records");
// groupby
$watch->start();
$grouped = $collection->groupBy(function (OA $r) {
return $r->username;
});
// count records in groups
$temp = $grouped->select(function (AL $c, $key) {
return array("key" => $key, "count" => $c->length());
});
L::vdl($temp);
L::line("Grouped by username.", $watch->stop()->result());
// select
$watch->start();
L::vdl($grouped['userfoo']->select(function (OA $r) {
return $r->uri;
}));
L::line("Select uris from userfoo.", $watch->stop()->result());
echo "\n";
// sum
$watch->start();
$sum = $collection->sum(function (OA $r) {
return $r->bytes;
});
L::line("Sum of bytes:", $sum, $watch->stop()->result());
// avg
$watch->start();
$avg = $collection->avg(function (OA $r) {
return $r->bytes;
});
L::line("Avg of bytes:", $avg, $watch->stop()->result());
示例2: array
$columns[] = array(8, number_format($records->avg(function ($v) {
return $v->outdoor->hudperc;
}), 2) . "%");
$columns[] = array(6, number_format($records->max(function ($v) {
return $v->outdoor->hudperc;
}), 2) . "%");
echo columnline($columns);
}
// Last 15 minutes
$date = clone $list->last()->timestamp;
$date->modify("-15 minutes");
$lastminutes = $list->where(function (ObjectArray $o) use($date) {
return $o->timestamp >= $date;
});
// Create JSON
$avg = array("date" => date('c'), "indoortemp" => $lastminutes->avg(function (ObjectArray $o) {
return $o->indoor->tempc;
}), "outdoortemp" => $lastminutes->avg(function (ObjectArray $o) {
return $o->outdoor->tempc;
}), "airhumidity" => $lastminutes->avg(function (ObjectArray $o) {
return $o->outdoor->hudperc;
}), "pressure" => $lastminutes->avg(function (ObjectArray $o) {
return $o->indoor->pressurehpa;
}), "brightness" => $lastminutes->avg(function (ObjectArray $o) {
return $o->brightness->lux;
}));
echo "\n";
L::vdl($avg);
echo "\n";
L::line("Finished. Total time:", $total->stop()->result());
echo "\n";