title: Division with Arrays
body: <pre><code>              &lt;?php
                   $txtfield = $_POST['number1'];
                    $arr = explode(' ',trim($txtfield));
                      $operator = $arr[0];
                            $count=count($arr);
  
                             $sum = array_sum($arr);
                                echo "Sum of the number:".$sum. "&lt;br&gt;";
  
                    $prod=1;
                     for ($i=1; $i&lt;$count; $i++){
                       $prod = $prod * $arr[$i];}
  
                            echo "Product of the numbers:".$prod."&lt;br&gt;";
  
                               $diff=$arr[1];
                               for ($i=1; $i&lt;$count; $i++){
                                     $diff= $diff - $arr[$i+1];
                         }
  
                               echo "Difference of the numbers:".$diff."&lt;br&gt;";
  
                                   $div=$arr[1];
                                       foreach ($i=1; $i&lt;$count; $i++){
                                     $div=$div / $arr[$i];
                            }
  
                                    echo "Qoutient of the numbers:". $div. "&lt;br&gt;";
                              ?&gt;
  </code></pre>
  
  <p>This line of code doesn't seem to work properly. When I entered <code>10</code> &amp; <code>5</code> the output is:</p>
  
  <pre><code>Sum of the number:15
  Product of the numbers:50
  Difference of the numbers:5
  Qoutient of the numbers:0.2
  </code></pre>