public static function arrayImplode($glue, $separator, $array = [])
    {
        if (!is_array($array)) {
            throw new BcaHttpException('Data harus array.');
        }
        if (empty($array)) {
            throw new BcaHttpException('parameter array tidak boleh kosong.');
        }
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $val = implode(',', $val);
            }
            $string[] = "{$key}{$glue}{$val}";
        }

        return implode($separator, $string);
    }
public static function arrayImplode($glue, $separator, $array = [])
    {
        if (!is_array($array)) {
            throw new BcaHttpException('Data harus array.');
        }
        if (empty($array)) {
            throw new BcaHttpException('parameter array tidak boleh kosong.');
        }
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $val = implode(',', $val);
            }
            $string[] = "{$key}{$glue}{$val}";
        }

        return implode($separator, $string);
    }
public static function arrayImplode ( $ glue , $ separator , $ array = [ ] ) { if ( ! is_array ( $ array ) ) { throw new BcaHttpException ( 'Data harus array.' ) ; } if ( empty ( $ array ) ) { throw new BcaHttpException ( 'parameter array tidak boleh kosong.' ) ; } foreach ( $ array as $ key => $ val ) { if ( is_array ( $ val ) ) { $ val = implode ( ',' , $ val ) ; } $ string [ ] = "{$key}{$glue}{$val}" ; } return implode ( $ separator , $ string ) ; }
Implode an array with the key and value pair giving
a glue, a separator between pairs and the array
to implode.

@param string $glue      The glue between key and value
@param string $separator Separator between pairs
@param array  $array     The array to implode

@return string The imploded array
Implode an array with the key and value pair giving a glue a separator between pairs and the array to implode .