3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('a', 'b', 'c', 'd', 'e', 'f'); //$str = implode(array_walk(array_reverse($arr), function($v,$k){if($k%3==0)$v.=';';})); //print_r(array_map(function($v){if($k%3==0)$v.=';';}), array_reverse($arr)); $str = str_reverse(chunk_split(implode(array_reverse($arr)), 3, ';')); echo $str;

preferences:
24.35 ms | 406 KiB | 5 Q