mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
parent
ae55711dc4
commit
14ffdbe5f0
6 changed files with 17 additions and 41 deletions
|
|
@ -635,18 +635,13 @@ class FileHandler
|
|||
*/
|
||||
function returnBytes($val)
|
||||
{
|
||||
$last = strtolower(substr(trim($val), -1));
|
||||
switch ($last)
|
||||
$unit = strtoupper(substr($val, -1));
|
||||
$val = (int)$val;
|
||||
switch ($unit)
|
||||
{
|
||||
case 'g':
|
||||
$val *= 1024 * 1024 * 1024;
|
||||
break;
|
||||
case 'm':
|
||||
$val *= 1024 * 1024;
|
||||
break;
|
||||
case 'k':
|
||||
$val *= 1024;
|
||||
break;
|
||||
case 'G': $val *= 1024;
|
||||
case 'M': $val *= 1024;
|
||||
case 'K': $val *= 1024;
|
||||
}
|
||||
|
||||
return $val;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue