protected function addValue(&$fieldsArray, $name, $value)
    {
        $arrayCheck = substr($name, -2);

        if ($arrayCheck == '[]') {
            $nameSubstr = substr($name, 0, -2);
            if (!isset($fieldsArray[$nameSubstr]))
                $fieldsArray[$nameSubstr] = [];

            $fieldsArray[$nameSubstr][] = $value;
        } else {
            $fieldsArray[$name] = $value;
        }
    }
protected function addValue(&$fieldsArray, $name, $value)
    {
        $arrayCheck = substr($name, -2);

        if ($arrayCheck == '[]') {
            $nameSubstr = substr($name, 0, -2);
            if (!isset($fieldsArray[$nameSubstr]))
                $fieldsArray[$nameSubstr] = [];

            $fieldsArray[$nameSubstr][] = $value;
        } else {
            $fieldsArray[$name] = $value;
        }
    }
protected function addValue ( & $ fieldsArray , $ name , $ value ) { $ arrayCheck = substr ( $ name , - 2 ) ; if ( $ arrayCheck == '[]' ) { $ nameSubstr = substr ( $ name , 0 , - 2 ) ; if ( ! isset ( $ fieldsArray [ $ nameSubstr ] ) ) $ fieldsArray [ $ nameSubstr ] = [ ] ; $ fieldsArray [ $ nameSubstr ] [ ] = $ value ; } else { $ fieldsArray [ $ name ] = $ value ; } }
Inserts the value into the passed array.
Used to parse input array from HTTP request body, if needed

@param array $fieldsArray
@param string $name name of the field
@param string $value value of the field
Inserts the value into the passed array . Used to parse input array from HTTP request body if needed