Site icon T4Tutorials.com

Octal to Hexadecimal Conversion Program Code in PHP

Octal to Hexadecimal Conversion Program Code in PHP

In this tutorial we will learn the code of “Octal to Hexadecimal Conversion Program Code in PHP”.

Code of “Octal to Hexadecimal Conversion Program Code in PHP”

<html>
<body>
<p>
Octal to Hexadecimal Conversion Program Code in PHP
</body>
</p>
</html>
<?php
echo "Octal Number = 7654<br>";
echo "After Change In Hexadecimalvalue =";
$oct = "7654"; 
echo base_convert($oct,8,16); 
?>

The output of code of”Octal to Hexadecimal Conversion Program Code in PHP”

Fig: Octal to Hexadecimal Conversion Program Code in PHP

 

Octal to Hexadecimal Conversion Program Code in PHP with form values entered by the user

In this tutorial, we will learn the code of “Octal to Hexadecimal Conversion Program Code in PHP with form values enter by user”

Code of “Octal to Hexadecimal Conversion Program Code in PHP with form values enter by the user”

<html>
<h3>Conversion from Octal To Hexadecimal</h3>
</html>
<html>
<body>
<form method="post">
Enter Octal Value:<br>
<input type="text" name ="num1"><br>
<input type="submit" name="submit"><br>
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
	$oct=$_POST['num1'];
        echo "The Value after Conversion  <br>";
	echo base_convert($oct,8,16);
	
	
	;}?>

The output of code of  “Octal to Hexadecimal Conversion Program Code in PHP with form values enter by user”

Figure: Octal to Hexadecimal Conversion Program Code in PHP with form values entered by the user
Exit mobile version