how can i access a variable defined inside a for each loop outside the loop?
<p>Here is my code...</p>

<pre><code>foreach ($relatedStories-&gt;getResults() as $story):
    $total+=$story-&gt;getEstimation();
endforeach;
</code></pre>

<p>$$relatedStories is an array of values.im summing the attribute estimation to total. 
Now i need to access the total value outside. How can i do so????</p>
