public static function addValue(array &$arr, $key, $value)
    {
        if (isset($arr[$key])) {
            if (!is_array($arr[$key])) {
                $arr[$key] = [$arr[$key]];
            }
            $arr[$key][] = $value;
        }
        else {
            $arr[$key] = $value;
        }
    }
public static function addValue(array &$arr, $key, $value)
    {
        if (isset($arr[$key])) {
            if (!is_array($arr[$key])) {
                $arr[$key] = [$arr[$key]];
            }
            $arr[$key][] = $value;
        }
        else {
            $arr[$key] = $value;
        }
    }
public static function addValue ( array & $ arr , $ key , $ value ) { if ( isset ( $ arr [ $ key ] ) ) { if ( ! is_array ( $ arr [ $ key ] ) ) { $ arr [ $ key ] = [ $ arr [ $ key ] ] ; } $ arr [ $ key ] [ ] = $ value ; } else { $ arr [ $ key ] = $ value ; } }
Add a value to an array

@param array $arr The array to add values to
@param string|number $key The index/key to add the value under
@param mixed $value The value to add
Add a value to an array