Answers for "how to show arraylist in comma separated with last and in php"

PHP
0

how to show arraylist in comma separated with last and in php

$last_element = array_pop($number_list);
array_push($number_list, 'and '.$last_element);

Then you can do your implode:

$comma_list = implode(', ', $number_list);
Posted by: Guest on April-15-2022
0

how to show arraylist in comma separated with last and in php

$last_element = array_pop($number_list);
array_push($number_list, 'and '.$last_element);
Posted by: Guest on April-15-2022

Code answers related to "how to show arraylist in comma separated with last and in php"

Browse Popular Code Answers by Language