Last active
August 29, 2015 13:57
-
-
Save luckyshot/a583e93e81db3aae3351 to your computer and use it in GitHub Desktop.
Enumerate list with commas and the last one with "and"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = (1,2,3); | |
$last = array_pop($array); | |
echo strtolower(implode(', ', $array)." and ".$last); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment