Armstrong number is a number that is equal to the sum of cubes of its digits. For example 0, 1, 153, 370, 371 and 407 are the Armstrong numbers.

Let's try to understand why 153 is an Armstrong number.

For Example:

153 = (1*1*1)+(5*5*5)+(3*3*3)  

where:  

(1*1*1)=1  

(5*5*5)=125  

(3*3*3)=27  

So:  

1+125+27=153  

Let Write full Script For Find Armstrong Numbers In Php Below

<?php

   if(isset($_POST['submit']))

   {

   $num=$_POST['num1'];

   $sum = 0;

   $temp = $num;

   while($temp != 0){

   $rem = $temp%10;

   $sum = $sum+$rem*$rem*$rem;

   $temp = $temp/10;

   }

   if($num == $sum){

echo "<h5 style='text-align:center'>  The Given Number " . $num ." is An Armstrong Number</h5>";

   }else{

   echo "<h5 style='text-align:center'>  The Given Number " . $num ." is An Not Armstrong Number</h5>";}

   }

   ?>

<!DOCTYPE html>

<html>

   <head>

      <title>Check Number Is Armstrong</title>

      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

   </head>

   <body>

      <div style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">

         <div class="panel panel-info" >

            <div class="panel-heading">

               <div class="panel-title">Check Number Is Armstrong</div>

               <div style="float:right; font-size: 80%; position: relative; top:-10px"></div>

            </div>

            <div style="padding-top:30px" class="panel-body" >

               <div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>

               <form name="add" method="post" class="form-horizontal" role="form">

                  <div style="margin-bottom: 25px" class="input-group">

                     <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>

                     <input  type="text" class="form-control" name="num1" value="" placeholder="Enter Number" required>                                        

                  </div>

                  <!--<div style="margin-bottom: 25px" class="input-group">

                     <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>

                     <input type="text" class="form-control" name="num2" placeholder="Enter Second Number" required>

                  </div>-->

                  <div style="margin-top:10px" class="form-group">

                     <!-- Button -->

                     <div class="col-sm-12 controls">

                        <input type="submit" value="Submit" name="submit" id="submit-btn" Class="btn btn-success" />

                     </div>

                  </div>

   

                </form>

            </div>

         </div>

      </div>

  

   </body>

</html>

Write the Script to check whether the number is Armstrong or not using Php And Html