Как то так?
function implodeEx($glue, $pieces, $glueEx = null)
{
if ($glueEx === null)
return implode($glue, $pieces);
$c = count($pieces);
if ($c <= 2)
return implode($glueEx, $pieces);
$lastPiece = array_pop($pieces);
return implode($glue, array_splice($pieces, 0, $c - 1)) . $glueEx . $lastPiece;
}
$a = array('a', 'b', 'c', 'd', 'e');
echo implodeEx(',', $a, ' and ');