English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Body2to36between10The numbers in the number are represented by the letters az, that is, a is10 、、 d is13, z is35etc.
Syntax
Parameter-num
The number to be converted-original_base2to36between10The numbers in the number are represented by the letters az, that is, a is10 、、 d is13, z is35etc.
to_base-The base to be converted to. The base mentioned here should be between2to36between10The numbers in the number are represented by the letters az, that is, a is10 、、 d is13, z is35etc.
The base_convert() function returns a string representing the number converted to the required base.
<?php $res = "0040"; echo base_convert($res,8,10); ?>
Output Result
32
<?php $res = "D365"; echo base_convert($res,16,8); ?>
Output Result
151545
Let's look at another example-
<?php $res = "101101"; echo base_convert($res,2,16); ?>
Output Result
2d