helpers/ArrayHelper.php
public static function addValue($key, $value, &$array, $glue = ' ')
    {
        if (isset($array[$key])) {
            if (!is_array($array[$key]))
                $array[$key] = explode($glue, $array[$key]);
            $array[$key][] = $value;
            $array[$key]   = array_unique($array[$key]);
            $array[$key]   = implode($glue, $array[$key]);
        } else
            $array[$key] = $value;
        return $array;
    }
public static function addValue($key, $value, &$array, $glue = ' ')
    {
        if (isset($array[$key])) {
            if (!is_array($array[$key]))
                $array[$key] = explode($glue, $array[$key]);
            $array[$key][] = $value;
            $array[$key]   = array_unique($array[$key]);
            $array[$key]   = implode($glue, $array[$key]);
        } else
            $array[$key] = $value;
        return $array;
    }
public static function addValue ( $ key , $ value , & $ array , $ glue = ' ' ) { if ( isset ( $ array [ $ key ] ) ) { if ( ! is_array ( $ array [ $ key ] ) ) $ array [ $ key ] = explode ( $ glue , $ array [ $ key ] ) ; $ array [ $ key ] [ ] = $ value ; $ array [ $ key ] = array_unique ( $ array [ $ key ] ) ; $ array [ $ key ] = implode ( $ glue , $ array [ $ key ] ) ; } else $ array [ $ key ] = $ value ; return $ array ; }
Adds a new option to the given array. If the key does not exists, it will create one, if it exists it will append
the value and also makes sure the uniqueness of them.

@param string $key the key name at the array
@param string $value the value to add / append
@param array $array the options to modify
@param string $glue how the values will be joined
@return array
Adds a new option to the given array . If the key does not exists it will create one if it exists it will append the value and also makes sure the uniqueness of them .