<?php $data = array(); $data[0] = 'apple'; $data[1] = 'banana'; $data[2] = 'car'; $data[3] = 'dog'; echo "1. first round<BR /> \n"; foreach($data as &$row) { echo "{$row} <BR /> \n"; } echo "2. second round<BR /> \n"; foreach($data as $row) { echo "{$row} <BR /> \n"; }
1. first round apple banana car dog 2. second round apple banana car dog
1. first round apple banana car dog 2. second round apple banana car car