It's not obvious from the samples, if/how associative arrays are handled. The "implode" function acts on the array "values", disregarding any keys:
<?php
declare(strict_types=1);
$a = array( 'one','two','three' );
$b = array( '1st' => 'four', 'five', '3rd' => 'six' );
echo implode( ',', $a ),'/', implode( ',', $b );
?>
outputs:
one,two,three/four,five,six