本文整理匯總了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];
}