<?php $arr = array ( 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four' ); $comma_separated = implode(", ", $arr); echo preg_replace('/\,([^,]+)$/', ' and $1', $comma_separated);
You have javascript disabled. You will not be able to edit any code.