本文整理汇总了PHP中Number::byteFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Number::byteFormat方法的具体用法?PHP Number::byteFormat怎么用?PHP Number::byteFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Number
的用法示例。
在下文中一共展示了Number::byteFormat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: memoryUsage
/**
* Get memory usage for current point
*
* <code>
* echo Debug::memoryUsage('point_name');
* </code>
*
* @param string $point_name Point name
* @return string
*/
public static function memoryUsage($point_name)
{
if (isset(Debug::$memory[$point_name])) {
return Number::byteFormat(memory_get_usage() - Debug::$memory[$point_name]);
}
}
示例2: str_replace
echo Number::byteFormat(filesize($files_path . DS . $file));
?>
</td>
<td>
<div class="pull-right">
<button class="btn btn-info js-file-info"
data-filename="<?php
echo str_replace('"', '\'', htmlentities($file));
?>
"
data-filetype="<?php
echo $ext;
?>
"
data-filesize="<?php
echo Number::byteFormat(filesize($files_path . DS . $file));
?>
"
data-dimension="<?php
echo htmlentities($dimension);
?>
"
data-link="<?php
echo $site_url . '/public/' . $path . $file;
?>
"
>
<?php
echo __('Info', 'filesmanager');
?>
</button>
示例3: rsort
if (count($backups_list) > 0) {
rsort($backups_list);
}
foreach ($backups_list as $backup) {
?>
<tr>
<td>
<?php
$name = strtotime(str_replace('-', '', basename($backup, '.zip')));
?>
<?php
echo Html::anchor(Date::format($name, 'F jS, Y - g:i A'), Option::get('siteurl') . '/admin/index.php?id=backup&download=' . $backup . '&token=' . Security::token());
?>
</td>
<td class="visible-lg hidden-xs"><?php
echo Number::byteFormat(filesize(ROOT . DS . 'backups' . DS . $backup));
?>
</td>
<td>
<div class="pull-right">
<?php
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
echo Html::anchor(__('Restore', 'backup'), 'index.php?id=backup&restore=' . $backup . '&token=' . Security::token(), array('class' => 'btn btn-primary'));
}
?>
<?php
echo Html::anchor(__('Delete', 'backup'), 'index.php?id=backup&delete_file=' . $backup . '&token=' . Security::token(), array('class' => 'btn btn-danger', 'onclick' => "return confirmDelete('" . __('Delete backup: :backup', 'backup', array(':backup' => Date::format($name, 'F jS, Y - g:i A'))) . "')"));
?>
</div>
</td>
</tr>
示例4: uploadSize
/**
* Get Upload Size
*/
public static function uploadSize()
{
return Number::byteFormat(min(Number::convertToBytes(ini_get('upload_max_filesize')), Number::convertToBytes(ini_get('post_max_size'))));
}