Number class

The following sections explain each method of the class.

scale_proportionally


public static array scale_proportionally ( float $sourceWidth, float $sourceHeight, float $destWidth = 0.00, float $destHeight = 0.00)

Calculates the size proportional to the desired format. Here, the best one of the two parameters should be $destWidth or $destHeight be empty.

Parameter list
sourceWidth

The original width in a decimal number

sourceHeight

The original height in a decimal number

destWidth

The desired width in a decimal number

destHeight

The desired height in a decimal number


byte_format


public static string byte_format ( float $num, int $precision = 1)

Converts a decimal to a computer by byte format. If, for example, passed 12345 value, 12.1 KB would come out.

Parameter list
num

The decimal byte should be converted into a computer.

precision

With much decimals, the result should be returned.


diff


public static object diff ( int $start, int|bool $end = false)

Returns the difference between two timestamps in the year, month, day, minute, and second.

Parameter list
start

The start date in UNIX timestamp format.

end

The end date in UNIX timestamp format or false if the current is to be taken.


get_diff_value


public static string get_diff_value ( object $diffDate, bool $short = false)

Is the difference back text. For this purpose, the method can be diff use to the appropriate object element to get as parameters.

Parameter list
diffDate

Must year, month, day, hour, minute and second included. It is best to the object of the method diff to take because it has all the structures.

short

Returns brief descriptions. For example, instead minute comes minute or second instead comes sec.