$animels = array("Dog", "Cat", "Tiger", "Lion", "Cow");
$count_animel = count($animels);
$set_count = 0;
foreach ($animels as $animel) {
echo $animel;
$set_count = $set_count + 1;
if ($set_count < $count_animel) {
echo ", ";
}
}