for($col = $pkFirstCol; array_key_exists($col, $arr[$j]); $col=$col+2)
                        {
                            // in $col we have the type and in $col-1 the value
                            if($arr[$j][$col]=='integer' || $arr[$j][$col]=='real')
                                // json encode as int or float, not string