Changeset 31052 for trunk/src/wp-includes/functions.php
- Timestamp:
- 01/05/2015 01:12:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r31044 r31052 183 183 * Convert number of bytes largest unit bytes will fit into. 184 184 * 185 * It is easier to read 1 kB than 1024 bytes and 1MB than 1048576 bytes. Converts185 * It is easier to read 1 kB than 1024 bytes and 1 MB than 1048576 bytes. Converts 186 186 * number of bytes to human readable number by taking the number of that unit 187 187 * that the bytes will go into it. Supports TB value. … … 207 207 'MB' => 1048576, // pow( 1024, 2) 208 208 'kB' => 1024, // pow( 1024, 1) 209 'B '=> 1, // pow( 1024, 0)209 'B' => 1, // pow( 1024, 0) 210 210 ); 211 foreach ( $quant as $unit => $mag ) 212 if ( doubleval($bytes) >= $mag ) 211 212 foreach ( $quant as $unit => $mag ) { 213 if ( doubleval( $bytes ) >= $mag ) { 213 214 return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit; 215 } 216 } 214 217 215 218 return false;
Note: See TracChangeset
for help on using the changeset viewer.