I think it would be simple but I seem not to get it done. what I want to do is to display value I get from FOREACH loop on top of other echoed values.
function writeMsg($total) {
echo $total. "< This must display First";
}
foreach ($array as $value) {
echo $value["Price"]."<br>";
$total = $value["Total"];
}
writeMsg($total);
Note that I already echo the value inside the foreach, but what I want is to echo the variable I got from
$total = $value["Total"];
before
echo $value["Price"]."<br>";
I hope you guys understand my issue!