below is from part of a loop
foreach($dataSet as $cType => $cPercentage){ echo $cType ."=". $cPercentage; }
this out put datas depend on array. what I want is I want to run this loop to only a particular number of times. say 8 times.
below is from part of a loop
foreach($dataSet as $cType => $cPercentage){ echo $cType ."=". $cPercentage; }
this out put datas depend on array. what I want is I want to run this loop to only a particular number of times. say 8 times.
$nLoop = 0;
foreach($dataSet as $cType => $cPercentage){
if ($nLoop++ == 8)
break;
echo $cType ."=". $cPercentage;
}