本文整理汇总了PHP中Console::left方法的典型用法代码示例。如果您正苦于以下问题:PHP Console::left方法的具体用法?PHP Console::left怎么用?PHP Console::left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console::left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (count($arr)) {
Console::left($new['name'], 30);
foreach ($arr as $key => $q) {
$DB->execute($q);
if (in_array($DB->getError(), $codes)) {
Console::write($key . ' ');
} else {
Console::write($key . ' ');
$error[] = $q;
}
}
Console::writeln();
} else {
}
} else {
Console::left($new['name'], 30);
// new table
$DB->execute($query);
if (in_array($DB->getError(), $codes)) {
Console::writeln('added');
} else {
Console::writeln('FAILED!');
//$error[] = $query;
$error[] = $DB->getError(true);
}
}
}
continue;
}
}
}
示例2: foreach
Console::write('|');
Console::left(' Total', 19);
Console::writeln('|');
Console::write('| ');
foreach ($stats['size'] as $i => $value) {
if ($i == 'a') {
break;
}
Console::left(count(${$i}), 4);
Console::left(File::getFilesize($stats['size'][$i], 'b,K,M,G'), 5);
Console::left($stats['lines'][$i] . 'L', 8);
Console::write('| ');
}
Console::left(count($m) + count($c) + count($v), 4);
Console::left(File::getFilesize($stats['size']['a'], 'b,K,M,G'), 5);
Console::left($stats['lines']['a'] . 'L', 8);
Console::writeln('|');
Console::write('\\');
Console::write(str_repeat('=', 98));
Console::writeln('/');
Console::writeln();
if ($argv[1]) {
$sign = '$';
$time = $price = 0;
$arr = explode('/', $argv[1]);
if (count($arr) == 2) {
$price = $stats['lines']['a'] / $arr[1];
$sign = $arr[0] ? $arr[0] : $sign;
} else {
$price = $stats['lines']['a'] * $arr[1];
}