BaseConversionTrait
+ Inheritance diagram for BaseConversionTrait:

Description

Further manipulate the expression in a different numeric base.

Since converting to base 10 only applies to character string expressions, its method can be found at ()

Public Methods

Str toBase (int $from, int $to)
 Convert between arbitrary bases. More...
 
Str toBase16 (int $from=10)
 Convert from an arbitrary base to base 16. More...
 
Str toBase2 (int $from=10)
 Convert from an arbitrary base to base 2. More...
 
Str toBase8 (int $from=10)
 Convert from an arbitrary base to base 8. More...
 

Methods

◆ toBase()

Str toBase ( int  $from,
int  $to 
)

Convert between arbitrary bases.

CONV($this,$from,$to)

Parameters
int$from
int$to
Returns
Str

◆ toBase16()

Str toBase16 ( int  $from = 10)

Convert from an arbitrary base to base 16.

CONV($this,$from,16)

Parameters
int$from
Returns
Str

◆ toBase2()

Str toBase2 ( int  $from = 10)

Convert from an arbitrary base to base 2.

CONV($this,$from,2)

Parameters
int$from
Returns
Str

◆ toBase8()

Str toBase8 ( int  $from = 10)

Convert from an arbitrary base to base 8.

CONV($this,$from,8)

Parameters
int$from
Returns
Str