Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Hexadecimal to Decimal Conversion Code in PHP

Hexadecimal to Decimal Conversion Code in PHP

<html>
<body>
<p>
Hexadecimal to Decimal Conversion Code in PHP
</p>
<?php
echo "hexadecimale value =";
echo "48656c6c6f20576f726c6421<br>";
echo "after conversion <br>";
echo hex2bin("48656c6c6f20576f726c6421");
?>
</body>
</html>

Output

Hexadecimal to Decimal Conversion Code in PHP

hexadecimale value =48656c6c6f20576f726c6421
after conversion 
Hello World!

Hexadecimal to Decimal Conversion Code in PHP with form Values Entered By User

<html>
<h3>PHP Program Code of Hexadecimal to Decimal Conversion </h3>
</html>
<html>
<body>
<form method="post">
Enter hexa Value:<br>
<input type="text" name ="num1"><br>
<input type="submit" name="submit"><br>
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
	$hexa=$_POST['num1'];
        echo "The Value after Conversion  <br>";
	echo base_convert($hexa,16,10);
	
	
	;}?>

Output

Hexadecimal to Decimal Conversion Code in PHP

Figure: Hexadecimal to Decimal Conversion Code in PHP

Topic Covered

Hexadecimal to Decimal Conversion Code in PHP.

Fazal Rehman Shamil Click Here to Know More
Instructor, Researcher, Blogger, SEO Expert, Poet and Publisher of International Journal Of Software, Technology & Science ISSN : 2616 - 5325
Dear Professors and Resarchers!You are welome to Cite these tutorials in your research or slides etc. Please don't forget to mention the reference of website. Copy Paste of text is strcitly forbidden. Images can be reuse because images are protected with watermark.