<?Php
echo hexdec('2e'); // Output 46
echo "<br>";
echo hexdec('2ch'); // Output 44
echo "<br>";
echo hexdec('fab'); // Output is 4011
echo "<br>";
echo hexdec('FFFFFF'); // Output is 16777215
?>
Syntax
string hexdec(string $hex);
Parameter | DESCRIPTION |
---|---|
$hex | Required : $hex string to convert to equivalent decimal number. |
$hex = "FF";
echo hexdec($hex); // Output: 255
$hex = "7FFFFFFF";
echo hexdec($hex); // Output: 2147483647
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.