Create an easy String using php function.

$new = array('a','b','c','d','e','f');
$comma_list = strrev(implode(strrev(' and'), explode(strrev(','), strrev(implode(', ', $new)), 2)));
echo 'The list is ' . $comma_list . '.';

The list is a,b,c,d,e and f.

Share on Google+Share on FacebookTweet about this on TwitterEmail this to someone
Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.