3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'a,b,c,d,e'; $arr = explode( ',', $str); $last = array_pop( $arr); $arr[] = array_pop( $arr) . $last; echo implode( ',', $arr);
Output for 4.3.0 - 7.1.0
a,b,c,de