title: Php, calculate percentage on multiple items
body: <p>I have 5 items in total, and I would like to calculate percentage based on [data] filed. The result will be used for pie chart.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [label] =&gt; Item1
              [data] =&gt; 849
          )
  
      [1] =&gt; Array
          (
              [label] =&gt; Item2
              [data] =&gt; 657
          )
  
      [2] =&gt; Array
          (
              [label] =&gt; Item3
              [data] =&gt; 571
          )
  
      [3] =&gt; Array
          (
              [label] =&gt; Item4
              [data] =&gt; 538
          )
  
      [4] =&gt; Array
          (
              [label] =&gt; Item5
              [data] =&gt; 446
          )
  
  )
  </code></pre>
  
  <p>Using:</p>
  
  <pre><code>(5/[data])*100
  </code></pre>
  
  <p>does not produce correct result, and I'm not sure how to perform proper calculations.</p>