← All docs

base_convert()

Converts a number between two arbitrary bases from 2 to 36.

base_convert()

function base_convert(string $num, int $from_base, int $to_base): string

Converts a number between two arbitrary bases from 2 to 36.

Parameters:

  • $num (string)
  • $from_base (int)
  • $to_base (int)

Returns: string

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how base_convert is implemented in the compiler, see the internals page.