Public Method Details |
length |
|
public string length( string $from, string $to, string $value, [ integer $precision ] )
|
| |
converts length.
can convert the following units (alphabetic listing):+---------------+------------------------------------+| KEY | DESCRIPTION |+---------------+------------------------------------+| cables | || cm | centimeters || chains | chains (surveyors) || dm | decimeters || ells | elles (UK) || fathoms | || feet | feet (UK and US) || furlongs | || hands | || hm | hectometers || inches | || km | kilometers || m | meters || miles | miles (UK and US) || milesNautical | miles (nautical) || mm | millimeters || yards | |+---------------+------------------------------------+not implemented but relations known: ångströms [Å], astronomical units [AU],barleycorns, ems (pica), feet (US survey), light years, micrometers, parsecs,picometers.
|
| Parameter |
|
| string |
$from |
|
|
(see key above) |
|
|
| string |
$to |
|
|
(see key above) |
|
|
|
|
| integer |
$precision |
= >>3<< |
|
to round. Using PHP's round() func. |
|
| Returns |
string |
| Throws |
FALSE (on unknown/misspelled units) |
|
temperature |
|
public string temperature( string $from, string $to, string $value, [ integer $precision ] )
|
| |
converts temperature.
can convert the following units:celsius, fahrenheit, kelvin, rankine, réaumure
|
| Parameter |
|
|
|
|
|
|
|
| integer |
$precision |
= >>3<< |
|
to round. Using PHP's round() func. |
|
| Returns |
string |
| Throws |
FALSE (on unknown/misspelled units) |
|
bitsAndBytes |
|
public string bitsAndBytes( string $from, string $to, string $value )
|
| |
converts bits, bytes etc.
can convert the following units:bits, bytes, kilobits, kilobytes, megabits, megabytes, gigabits, gigabytes,terabits, terabytes, petabits, petabytes, exabits, exabytes
|
| Parameter |
|
|
|
|
|
|
| Returns |
string |
|
toUsefulBitAndByteString |
|
public string toUsefulBitAndByteString( mixed $bytes )
|
| |
takes a number of bytes and converts it to a useful string.
eg (todo)
|
| Parameter |
|
| mixed |
$bytes |
|
|
(numeric, can be string int double) |
|
| Returns |
string |
|
unitStringToBytes |
|
public int unitStringToBytes( mixed $unitStr )
|
| |
Takes a string with unit (200KB, 1.2M, 0.23G, ...) and converts ist to bytes (int or float)
Acceped units (case insensitive): K,M,G,T,P,E and KB,MB,GB,TB,PB,EBPARAM:If numeric we assume it as absloute byte size.If string it may end with 'k' of 'M' (for kilo-,Mega-byte) OR '%'If ending with '%' this means use x% of the available memory as given bymemory_limit in the php.ini file. But we never exeed 80%.
|
| Parameter |
|
| mixed |
$unitStr |
|
|
(see above) |
|
| Returns |
int The set buffersize in byte. |
| Throws |
FALSE on error. (Buffer size is left unchanged) |
|
Bs_UnitConverter |
|
public void Bs_UnitConverter( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|