Lets I have an array like this
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
<?php
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
?>
<div id="3">
<!-----result of foreach loop---->
</div>
<div id="1">
<?php
foreach ($age as $key => $value) {?>
<p><?php echo $value;?></p>
<?php
}
?>
</div>
<div id="2">
<!-----result of foreach loop---->
</div>
<?php
?>
I want to print the same result in <div id="2"> and in <div id="3"> , without loop through the array in , I just want to use the loop only for one time .