$fromages) { // count the number of cheeses $count_cheeses=count($cheeses_produced[$region]); print "$region produces "; // first case: only one cheese if($count_cheeses==1) { print $cheeses_produced[$region][0]; } else { print "$count_cheeses cheeses: "; // use an enumerator to count through // the cheesse, just to make sure with // get the word "and" with the last cheese $enumerator=0; while($enumerator < $count_cheeses-1) { print $cheeses_produced[$region][$enumerator]; print ", "; $enumerator++; } // last cheese. print "and "; print $cheeses_produced[$region][$count_cheeses-1]; } // and now the dot at the end of the sentence print ".
"; } ?>

Valid XHTML 1.0!