How To Implement PHP Code For Subtracting Two Numbers

admin_img Posted By Bajarangi soft , Posted On 27-11-2020

Using PHP we can subtract two numbers.So today we implement php code for subtracting two numbers

How To Implement PHP Code For Subtracting Two Numbers

Complete Code For Implementing PHP Code For Subtracting Two Numbers.

<!DOCTYPE html>
<html>
<head>
    <title>How To Implement PHP Code For Subtracting Two Numbers</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: black;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: white;">Implement PHP Code For Subtracting Two Numbers</h1>
    </div>

    <div class="well">
        <form action="" method="post" enctype="multipart/form-data">
            <label>Number 1</label>
            <input type="text" name="number1" value=""><br><br>
            <label>Number 2</label>
            <input type="text" name="number2" value=""><br><br>
            <input type="submit" value="submit" class="btn btn-success" name="submit">
        </form>
        <?php
        if (isset($_POST['submit'])) {
            $n1=$_POST['number1'];
            $n2=$_POST['number2'];
            $output =$n1-$n2;
            echo "$n1 - $n2 =".$output ;
        }
        ?>
    </div>
</div>
</body>
</html>

Related Post