Programming Code Center(PCC)
[PHP]

(PCC)::[how-to-accept-value-from-user-and-perform-subtraction-of-two-numbers-in-php]::[php]

File Name : index.php

<html>  
<body>  
<form method="post">  
Enter First Number:  
<input type="number" name="number1" /><br><br>  
Enter Second Number:  
<input type="number" name="number2" /><br><br>  
<input  type="submit" name="submit" value="Sub">  
</form>  
<?php  
    if(isset($_POST['submit']))  
    {  
        $number1 = $_POST['number1'];  
        $number2 = $_POST['number2'];  
        $sub =  $number1-$number2;     
echo "The sub of $number1 and $number2 is: ".$sub;   
}  
?>  
</body>  
</html>  

Output :

Enter First Number:

Enter Second Number: