- array_keys: documentation ( source)
- current: documentation ( source)
<?php
$array = [
'first','second','third'
];
$firstKey = current(array_keys($array)); # get first array key
foreach ($array as $key => $value)
{
echo ($key !== $firstKey ? ', ' : ''). $value;
}