<?php error_reporting(); $array = array('a' => 'R', 'b' => 2, c => '2'); foreach($array as $element) print("$element,"); $limit = count($array); for($i = 0; $i < $limit; $i++) printf("%s,", $array[$i]); ?>