Say I have an array:
$array = Array( \'foo\' => 5, \'bar\' => 12, \'baz\' => 8 );
And I\'d like to print a line of text in m
You could print out the values as you iterate:
echo 'The values are: '; foreach ($array as $key => $value) { $result .= "$key ($value),"; } echo rtrim($result,',');