base_convert in PHP

Syntax of base_convert

string base_convert(string number, int from, int to)

Converts number from one base to another. The base the number is currently in is from, and the base to convert to is to. The bases to convert from and to must be between 2 and 36. Digits in a base higher than 10 are represented with the letters a (10) through z (35). Up to a 32-bit number, or 2,147,483,647 decimal, can be converted

Example of base_convert

<?php
$hexadecimal = 'a37334';
echo base_convert($hexadecimal, 16, 2);
?>
101000110111001100110100

Leave a Comment