The Byte conversion function is used to convert kb to mb, gb, tg, eb, pb and other units. This function is very useful for file uploading. We will share with you a function below. The Byte conversion function is used to convert kb to mb, gb, tg, eb, pb and other units. This function is very useful for file uploading. We will share with you a function below.
Script ec (2); script
The Code is as follows:
// Byte ConversionFunction conversion ($ size ){$ Kb = 1024; // 1K
Org. neodatis. ODB. Core. Io. bytearrayconverter
The function of this class is: converts array of bytes into Native objects and native objects into array of bytes
Public class bytearrayconverter {......
/*** Bit binary bits (or bits) byte 1 byte = 8bit kilobyte (Kb) kilobytes of megabyte (MB) megabytes* 1 MB = 1024kb = 1024*1024 byte gigabyte (GB) terabyte (TB) Too byte petabyte (PB)* Exabyte (EB) zetabyte
The most basic capacity unit used by a computer to indicate the size of a bucket is
Byte: bytes are the units in which information is transmitted over the network (or stored in hard disk or memory.
Bytes
Open Category: Computer, unit, storage, capacity, optical storage
Z tianjiéByte: bytes are the units in which information is transmitted over the network (or stored in hard disk or memory. Byte is a unit of measurement used by Computer Information Technology to measure sto
gigabyte/monthly billing method.
(1) SQL database: a relational database provided by Windows Azure, also known as SQL azure. Supports most relational database features. for developers familiar with SQL Server or other relational databases, the use of SQL database is similar. SQL database is not only a DBMS on the cloud, but also a PAAs service. You can still control your data and manage access permissions, SQL database
It helps you complete other man
Storage Capacity Unit: Bit, Byte, KB, MB, GB, TB, PB, EB, ZB, YB, zbyb
I recently read the Hadoop authoritative guide book, which has been designed by many organizations,
However, my previous books seem to only teach GB,
The current textbooks may be terabytes or petabytes of data, but I'm not sure. However, in the near future, there may be larger units that can be used,
These days I 've been playing a boring game that tests my brain capacity, and I 've learned more about storage capacity uni
personalization groups, which are dedicated to providing quality personalized recommendations and sequencing services at billion levels per day for American mission users. From terabyte-level user behavior data to gigabyte-level DEAL/POI data, the recommended and reordered systems require multiple types of data services, from real-time geo-location data to real-time data, to periodic background jobs. Refer
readers to do the serialization selection.Brief introductionThe author of the article serves the group's recommendations and personalization groups, which are dedicated to providing quality personalized recommendations and sequencing services at billion levels per day for American mission users. From terabyte-level user behavior data to gigabyte-level DEAL/POI data, the recommended and reordered systems re
'; break; default: $ unit = 'unknown unit';} return sprintf ('%. 2f ', $ B ). $ unit ;}}
Call:
echo formatSize('20667564');
The result is:
19.71MB
Note:
Here, the $ B parameter is a number in the unit of B, and $ times is used to identify the number of recursion of this function.
For the unit TB, PB, EB, and ZB that are not commonly used, refer to the following remarks (from the network ):
1 bit (this bit represents a binary number) 1 Byte (this word is also called "bit" but represents a he
PHP obtains the folder size function usage instance. PHP getting folder size function usage example this article describes PHP getting folder size function usage. Share it with you for your reference. The details are as follows :? Getting folder size f PHP getting folder size function usage example
This example describes how to use PHP to obtain the folder size function. Share it with you for your reference. The details are as follows:
?
// Get the folder size
Function getDirSize ($ dir)
{
$ Ha
The approximate program idea is to use the recursive rules to calculate the amount of space occupied by the directory, and then the value of the space to write into the text file, so long as the access to the TXT file will know how much space occupied, do not have to read the disk frequently, save resources. Each time a user uploads a file or deletes a file, it is re-counted. Of course, you can also save the statistical results in the database.
Copy CodeThe code is as follows:
function Countdir
sprintf ('%.2f ', $b). $unit;}}
Call:Copy the Code code as follows: Echo formatsize (' 20667564 ');The result is:
19.71MB
Description
Where the parameter $b is a number in B, $times is used to identify how many times the function is recursive.
The non-commonly used units TB, PB, EB, ZB please refer to the following notes (from the network):
1bit (this bit represents a binary number)1Byte (this word is also called "bit") but it represents a hexadecimal number.1b=1byte=8bit1 KB = 1024x768 B (kb-k
Storage capacity: Is the maximum number of data that can be stored on the storage device, typically using kilobytes (KB kilobyte), megabytes (MB megabyte), gigabytes (GB, gigabyte), terabytes (TB, terabyte), and Pb (Petabyte), EB ( Exabyte), etc. to measure.1Byte (equivalent to an English letter, a kanji account of 2 byte)1kb=2 (b=1024b); Quite a short story.1mb=2 (kb=1024kb=2) B; Quite the text of a short
';
Switch ($ times ){
Case '0': $ unit = 'B'; break;
Case '1': $ unit = 'kb'; break;
Case '2': $ unit = 'mb'; break;
Case '3': $ unit = 'gb'; break;
Case '4': $ unit = 'tb'; break;
Case '5': $ unit = 'petab'; break;
Case '6': $ unit = 'EB '; break;
Case '7': $ unit = 'zb'; break;
Default: $ unit = 'unknown unit ';
}
Return sprintf ('%. 2f', $ B). $ unit;
}
}
Call:
The Code is as follows:Echo formatSize ('000000 ');
The result is:
19.71 MB
Note:
Here, the $ B parameter is a number in the uni
disassembled by default.025 026-c, -- show-children027 Show a DIE's children when using the -- debug-info = OFFSET, -- find, 028 and -- name options.029 030 -- eh-frame [= SECTION] 031 Dump exception handling fra Me information from the optional SECTION032 parameter. the _ eh_frame section will be dumped by default.033 034-e, -- english035 Print dwarf tags and attributes in a more readable format instead036 of using the dwarf tag _ and AT _ definitions.037 038 -- file-stats [= size] 039 Show fi
The example in this article describes the use of PHP to get folder size functions. Share to everyone for your reference. Specifically as follows:
?
Get folder Size
function Getdirsize ($dir)
{
$handle = Opendir ($dir);
while (false!== ($FolderOrFile = Readdir ($handle)))
{
if ($FolderOrFile!= "." $FolderOrFile!= "...")
{
if (Is_dir ("$dir/$FolderOrFile"))
{
$sizeResult + + getdirsize ("$dir/$FolderOrFile");
}
Else
{
$sizeResult + + filesize ("$dir/$FolderOrFile");
}
}
}
Clos
Exposure to computers all day, inevitably with a variety of measurement units to deal with, especially data, but you know bit, Byte, KB, GB, TB and so on all means how much data? Have you heard of EB, ZB, YB?
Bit (bit) is the initials of binary digit, the unit that measures information, and the smallest unit that represents the amount of content, only 0 or 12 binary states. 8 bits make up a byte (byte), can hold an English character, and a Chinese character requires two bytes of storage space,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.