Result with and
in the end:
$titleString = array('apple', 'banana', 'pear', 'grape');
$totalTitles = count($titleString);
if ($totalTitles>1) {
$titleString = implode(', ', array_slice($titleString, 0, $totalTitles-1)) . ' and ' . end($titleString);
} else {
$titleString = implode(', ', $titleString);
}
echo $titleString; // apple, banana, pear and grape