Most voted "array" questions
An array (array, vector, or matrix) is an ordered data structure representing a collection of elements (values or variables), each identified by one or multiple indices.
Learn more…3,046 questions
Sort by count of
-
0
votes1
answer76
viewsPHP is not returning query data
Hello, I am using the following code to return regions: $query = 'SELECT * FROM Regiao'; $json = array(); $result = mysqli_query ($conn, $query); while($row = mysqli_fetch_array ($result)) { $regiao…
-
0
votes1
answer502
viewsHow to pass values from a list in Ionic3
Talk guys, I’m breaking my head with something "presently" simple, more not so much... I have a simple json with id and name, with approximately 25 records, I have to take only the records selected…
-
0
votes2
answers679
viewsStrings and Arrays, problems getting the right result
The goal of the program is to show information on one option and a 10 question survey on another option. Each discipline has 10 questions, and each discipline is done in a subprogram. the problem is…
-
0
votes0
answers190
viewsLook for numbers in the multidimensional array (multiple layers)
I would like to search for a certain number in this array ($arrayJobsAtivos): Array ( [0] => Array ( [seg] => Array ( [manha] => 1 [tarde] => 1 ) [ter] => Array ( [manha] => 1…
-
0
votes0
answers27
viewsUse Insert or Delete using SQLI PREPARE with array
In the old method I used this way too much to insert or delete a series lines coming from an array. note that the variables are inside conchetes {$x} already using the PREPARE method msqli I can’t…
-
0
votes1
answer655
viewsTwo arrays in foreach js
I have a Javascript function that sends requests with the content of a line textarea, is a looping that traverses an array and sends requests with the data of these indexes of the array, the problem…
-
0
votes1
answer48
viewsAdd items to the array without creating a new level
I have the following routine that generates an array for me: $tipo = "V"; if($tipo == "V"){ $addonTypeSuccess = ["size" => 10, "option" => 'classic', "type" => "volume"]; }…
-
0
votes3
answers841
viewsMerge two database array and delete repeated values
I need urgent help, I’m doing a database query on several different array. When the information with "implode" and picked up again with "explode", however, I get repeated values and I wanted the…
-
0
votes0
answers48
viewsAdd items in the list and click the remove items button and add other items instead
I have tried it in several ways and so far without an exact success, for now what I want in the application is that I type the number in the input, and when I click enter, the numbers are aligned in…
-
0
votes2
answers1600
viewsVector size in C
I am new to the C language and am getting problems to determine the size of vectors of the struct type. Example. I have a category type structure with three types of variables 1 int and 2 char.…
-
0
votes1
answer796
viewsCopy values from a PHP array
I have two arrays dynamics in my system: Array 1: $nome { [0] => nome1 [1] => nome2 } Array 2: $contagem { [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 } These two arrays, are…
-
0
votes1
answer282
viewsHow to pass an array to a property?
I am trying to pass an array of Strings and two Talignment arrays to three properties (Published). But I’m having the following mistake (which is the same for the three properties): [dcc32 Error]…
-
0
votes4
answers3471
viewsMatrix generator in Python
The program does the following: I say the number of rows and columns I want in my matrix and then assign a value to each column in each row, the problem is that when I specify the number of rows…
-
0
votes0
answers37
viewsJquery 1.11.3 - Code does not work within $(Document) loaded function. ready only if inserted directly
ISSUE #1 I discovered that the code was not working, because this chunk of Jquery code is inside a function like this: var minhaFuncao = function(){ var tbASP = []; var tbID = [];…
-
0
votes3
answers682
viewsSum of an array and PHP value concatenation
I have a dynamic array, it contains duplicate keys (TAG): [0] => Array ( [0] => Array ( [tag] => 5x1 Acessori Kids [pedido] => 6701622409 [quantidade] => 2125 ) ) [1] => Array (…
-
0
votes1
answer42
viewsSave information from an array to each function call
have a function in my javascript code, in this function is filled information in a variable that will be added at the position of a vector, I will try to illustrate with parts in pseudocode the…
-
0
votes1
answer102
viewsTransform array records into another multidimensional array
I want to transform this array: array:6 [ 0 => { "saldo": "-257,21" "id_mes": 1 "ano": "2018" } 1 => { "saldo": "-257,21" "id_mes": 2 "ano": "2018" } 2 => { "saldo": "0" "id_mes": 1 "ano":…
-
0
votes0
answers36
viewsData Issues Node.js (SQL Data)
I have a question regarding receiving SQL data in a Javascript array. I have the login information and everything, related to the server, but the issue is not the connection, is to save the data in…
-
0
votes1
answer63
viewsdoubt with nesting json / array
have this json { "MedPaciente": [ { "ProdutoModel": { "LaboratorioModel": { "id_laboratorio": 7951, "nome": "BOEHRINGER INGELHEIM", "data_cad": "28/12/2017", "situacao": 1 }, "id_produto": 232,…
-
0
votes1
answer43
viewsHow to create an array the same size as another array without copying it?
private void InversaoString(string Texto, int Tamanho) { char[] arrChar = Texto.ToCharArray(); char arrChar2; int indice = 0; for(Tamanho = arrChar.Length-1; Tamanho>=0; Tamanho--) {…
-
0
votes2
answers580
viewsRecover php array data via index value
My array in print_r displays like this: [ { "id": "A220", "name": "Dipirona", "symbol": "R$", "rank": "1", "price_br": "8.4", "price_usd": "2.0" "total_supply": "287.0", "max_supply": "21000.0",…
-
0
votes1
answer155
viewsImport external URL array with PHP
That link https://api.coinmarketcap.com/v1/ticker/ generates an array, I would like to import it into a local array, as I do ? I tried to make: $url = "https://api.coinmarketcap.com/v1/ticker/";…
-
0
votes1
answer88
viewsHow to structure multidimensional array with json
Good night!! I have a json that returns in this format: {rua: "A01", col: "01D", alt: "A"},{rua: "A01", col: "01D", alt: "B"},{rua: "A01", col: "01D", alt: "C"},{rua: "A01", col: "01D", alt: "D"}…
-
0
votes1
answer91
viewsHow do I insert elements of a first vector into another second vector, at a given user position? and still print step by step
Entradas - Tam do 1 vetor:5/ Elementos do 1 vetor: 1 2 3 4 5 / Elementos do 2 vetor: 6 7 8 9 10/ Pos a ser inserida: 1 Saida- 6 1 7 8 9 10 / 6 2 1 7 8 9 10 / 6 3 2 1 7 8 9 10 / 6 4 3 2 1 7 8 9 10/ 6…
-
0
votes0
answers39
viewsThe value change in the integer array in one index works in one case, and in another it doesn’t, why?
private void btnRodaLabirinto_Click(object sender, EventArgs e) { char[,] Lab = new char[10, 10]; int[,] Lab2 = new int[10, 10]; int I = 0, J = 0; Random NumerosRandomicos = new Random(); //abaixo,…
-
0
votes1
answer105
views -
0
votes1
answer34
viewsfunction suitable for accessing array values
I have a file with a function that takes all records from a table, as below. window.lerTabelaListas=function() { lista=new Array(); db.transaction(function (tx) { tx.executeSql('SELECT * FROM…
-
0
votes1
answer34
viewsFunction Result in an Object Array?
How to turn the output of this function into a array? In the future I would like to call only the result of a specific line, such as $palavraschave[1]. <?php $url=…
-
0
votes1
answer147
viewsSMPSEQ3 problem - Fun with Sequences - SPOJ
Good morning. I would like a help to create a code that is accepted by SPOJ. The proposed problem is the following: "You get an ordered sequence of n integers S = S1, s2, ..., Sn and an ordered…
-
0
votes1
answer28
viewsI am making a simple program to study Vectors, when I run it appears the error "Index was Outside the Bounds of the array" on line 24
using System; public class Program { public static void Main() { int i, n; Console.WriteLine("Entre com o número de Alunos: "); n = Convert.ToInt32(Console.ReadLine()); String[] nome = new String…
-
0
votes1
answer211
viewsError separating arrays in PHP
I have a PHP class responsible for sending tax notes, however it returns the following error, as if trying to pass an array to variable: [13-Mar-2018 14:08:26 America/Sao_Paulo] PHP Notice: Array to…
-
0
votes1
answer72
viewsReading of files in Java
public static void loadfile(stock []a) throws IOException{ String fich; File fichDad; int i=countDatas(a); while(sc.nextLine().length()!=0); do{ System.out.print("\nQual é o nome do ficheiro que…
-
0
votes1
answer215
viewsArray help with multiple PHP levels?
I’m getting this array: Array ( [0] => {"Status": {"Alerta": ["Uma ou mais companhias n\u00e3o retornaram voos"], "Erro": false, "Sucesso": true [1] => Busca": {"Criancas": 0, "Adultos": 1,…
-
0
votes1
answer40
viewsWhy does the matrix get extra lines?
private void abrirLabirintoToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog Abrir = new OpenFileDialog(); Abrir.ShowDialog(); string CarregaArq = null; string teste = null;…
-
0
votes1
answer245
viewsC separate string with commas in vectors
I want to separate each line of a file into 2 vectors: v[i]. date and v[i].value. However, when I run the code no value I print is correct, and the outputs are random values. There’s something I…
-
0
votes2
answers1235
viewsHow to access a list within a list in Vuejs?
I’m having difficulty listing the values of a Json, but it results from it is an array within an array as you can see below; { "status": true, "valores": { "USD": { "nome": "D\u00f3lar", "valor":…
-
0
votes2
answers2596
viewsPHP array_push in array within another array
Good evening, I need to create a php code that meets the following situation: I have an array of arrays $arrayTudo = [$array1, $array2, $array3]; I calculate an X value and want to play it in…
-
0
votes1
answer188
viewsHow to iterate PHP array received as JSON?
I got the following JSON, that I create by the method JSON.stringify(dados), and walkthrough ajax to the php: {"nome":"nome_da_pessoa", "registro":"registro_da_pessoa",…
-
0
votes1
answer93
viewsHow to pass the registration code as a function parameter?
I have to sort down the salaries of employees of a company. Entree: Tuition, salary, if you wish to continue Exit: Wages in descending order. The error that is appearing is the following: [Warning]…
-
0
votes1
answer86
viewsC# controller function receive an array
I need to take a select array and send it to a function in the controller, but it always arrives as null, even sending the full array. Below is the code: Controller: [AcceptVerbs(HttpVerbs.Get)]…
-
0
votes1
answer360
viewsSeparate Array within Object
I have an array inside an object, I would like to know how to separate the items service_name and service_value. I don’t know if there’s a way to do this in html itself... pedido{id_pedido:"17",…
-
0
votes2
answers1230
viewsHow do I return only the highest value within an array?
It does not correctly check the largest. For each animal it shows the weight of the animal as being the largest. #include <stdio.h> #include <stdlib.h> #include <string.h> #include…
-
0
votes1
answer61
viewsCount an array of a function?
How do I do echo of counting the result of the following function? public function get_Myinteresses() { global $db; $myInteresses = array(); $get_interids = $db->query(sprintf("SELECT * FROM…
-
0
votes1
answer251
viewsHow to read and sort this PHP json?
{ "groups": { "superadmin": true, "admin": true, "user": true, "Hitman": true }, "customization": { "1": [0, 0, 2], "2": [0, 0, 0], "3": [17, 0, 2], "4": [98, 1, 2], "5": [51, 0, 2], "6": [51, 0,…
-
0
votes0
answers255
views -
0
votes2
answers82
viewsWorking with vectors / matrices
Hello, I have the following question, I have 5 vectors string[] Defesa = { "Gigante", "Golem", "Gigante Real" }; string[] AtkTorre = { "Corredor", "Ariete de Batalha", "Gigante Real" }; string[] AP…
-
0
votes1
answer75
viewsUpdate values in a matrix keeping elements already modified earlier
I’m creating a game board, using a 2d array array. During the game players hit or miss and this has to be printed on the board. I would like to know how I can update the matrix without losing and…
-
0
votes1
answer181
viewsPython strip() function malfunction
I have a list in a file, where each line has a user agent (with " at the beginning and end of each line), which is used in a later part of a program, to perform automated tests using Selenium. When…
-
0
votes0
answers60
viewsHow to structure data for JSON with PHP
I have the return of a query that brings me the following items from the following query (OBS : are tables created for examples) select * from alunos a left join financs f on f.aluno_id = a.id left…
-
0
votes1
answer175
viewsWhy does my array return a Undefined
I have this code, but I want to access a certain attribute of a object who is within an array, but is returning Undefined obj1 = { nome : 'name', array : [], funcao :…