Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3.3.16 Release
#8
replace basic.php tobytes() with the one from 3.4

PHP Code:
/**
 * Convert to Bytes
 * convert M/G/K byte string to bytes
 * 100M returns 100*1024*1024
 * @since 3.0
 *
 * @param $str string
 * @return string
 */
function toBytes($str){
    
$val trim($str'gmkGMK');
    
$last strtolower($str[strlen($str)-1]);
        switch(
$last) {
            case 
'g'$val *= 1024;
            case 
'm'$val *= 1024;
            case 
'k'$val *= 1024;
        }
    return 
$val;

NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
3.3.16 Release - by RandyC - 2020-03-09, 11:36:21
RE: 3.3.16 Release - by shawn_a - 2020-03-10, 01:07:38
RE: 3.3.16 Release - by shawn_a - 2020-03-10, 01:10:07
RE: 3.3.16 Release - by RandyC - 2020-03-10, 04:13:32
RE: 3.3.16 Release - by Oleg06 - 2020-03-15, 23:06:47
RE: 3.3.16 Release - by Oleg06 - 2020-03-16, 03:32:35
RE: 3.3.16 Release - by craiga - 2020-03-31, 00:40:07
RE: 3.3.16 Release - by bafrali55 - 2020-03-16, 07:33:30
RE: 3.3.16 Release - by shawn_a - 2020-03-17, 22:43:22
RE: 3.3.16 Release - by Oleg06 - 2020-04-23, 00:49:31
RE: 3.3.16 Release - by Oleg06 - 2020-04-23, 03:45:14



Users browsing this thread: 1 Guest(s)