Online Forum To Support Coders With Technical Assistance - Read Write Execute

Create an easy String using php function.

Ankit Agrawal
Ankit Agrawal
Published on March 16, 2017 · 1 min read
$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 . '.';

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

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article How to get woocommerce page urls Next Article → 404 redirect in .net website