title: show result of a variable in php echo value
body: <p>I have a file in PHP to sum values of a JSON file (sum.php) and in this file i put:</p>
  
  <pre><code>    &lt;?php
  
  // Get json from url
  $json = file_get_contents("file.json");
  // Decode json into an array
  //$json = json_decode($content, true);
  $data =  json_decode($json, TRUE);
  
  // Set default
  $total = 0;
  
  // Loop through the array created when decoding json
  foreach ($data as $key) 
  {
      // remove symbol from the end leaving only digits
      $value = substr(utf8_decode($key['initialContractualPrice']), 0, -1);
      // remove the decimal point
      $value = str_replace('.', '', $value);
      // replace the comma with a decimal point
      $value = str_replace(',', '.', $value);
      // add this number to the total value
      $total += $value;
  }
  
  echo $total;
  
  ?&gt;
  </code></pre>
  
  <p>In other file that haves a button with a <code>&lt;input type="submit" name="soma" value="Somar Valores" class="btn btn-primary" formaction="sum.php"/&gt;</code> to sum.php and when i click on this buttom doesn't show result on page.</p>
  
  <p>How i resolve it, can you help me?</p>