Most voted "multidimensional-array" questions
Multidimensional arrays are data structures that store values in more than one dimension. In other words, a multidimensional array is like a container that will hold more values for each position, that is, as if the array elements were in turn other arrays.
Learn more…138 questions
Sort by count of
-
1
votes1
answer55
viewsReceive array values
How I receive the values of this checkbox? <input type="checkbox" name="Item[<?php echo $IDCatalogo; ?>][<?php echo $IDItem; ?>]"> foreach( $_POST['Item'] as $key => $n ) {…
-
1
votes1
answer5815
viewsChanging values of a two-dimensional array - PHP
Hello. I need to assemble a foreach to update the array values below: Array ( [0] => Array ( [id] => 1 [profissao] => Ajudante de cozinha [interesse] => ) [1] => Array ( [id] => 2…
-
1
votes0
answers37
viewsWhat is the difference between Jagged arrays and multidimensional arrays, and what application is indicated for each one?
I would like to better understand the difference between Jagged arrays and multidimensional arrays, and how each type should be applied in practice.
-
1
votes1
answer48
viewsProblems with C arrays input
I intend to make a simulator of memory ram in C and need to manipulate strings, at first I would like to use a 4x4 array for input of 4 memory positions with 4 bits: 1010 1000 1011 0000 Something…
-
1
votes2
answers668
viewsNG-REPEAT inside NG-REPEAT - ANGULARJS
I have a multidimensional array. To demonstrate it in my view I use an ng-repeat in a ul inside another ng-repeat in a li, thus: <ul ng-repeat="section in sections"> <li>…
-
1
votes2
answers1157
viewsHow to make a foreach in Javascript?
My application returns an array array, in which campanhas[] is an array of campanha[] which is also an array. How can I make a foreach to pick up each campaign from within the array campanhas? Below…
-
1
votes1
answer403
viewsHow to 'Loop' in Multi-dimensional Array in Bash?
Situation: I need to create a multi-dimensional array script. Example: Table 1 >> Campos id and name Table 2 >> Campos id and telephone Current script: #!/bin/bash declare -A arr…
-
1
votes0
answers862
viewsCreating multidimensional array from query to BD Mysql
I have the following problem: I have a table in a Mysql database and in a code snippet I need to make the content recovered by a query made to this database be stored in a multidimensional…
-
1
votes2
answers426
viewsExtract a new array from an array - Ruby
I have the following exit: => [ [ 0] [ [0] "CELULA", [1] "LENNA ", [4] "jul 01", [5] " 2015 12:00:00 AM", [6] "N", ], [ 1] [ [0] "CELULA", [1] "ARI [4] "jul 01", [5] " 2015 12:00:00 AM", [6] "P",…
-
1
votes0
answers51
viewsChange contents in a given position in a multidimensional array within a structure
I’m having trouble modifying the content in a given position of a multidimensional array that is within a structure. I have two structures struct TabelaFilial and struct ArrTabela. The structure…
-
1
votes1
answer45
viewsCheck for string in a PHP multidimensional array
I have the following array: array => [ "c2_unid" => array:2 [ 0 => { "tipologia": "Tipologia" } 1 => { "c2_unid": "Tipo" } ] "c1_unid" => array:2 [ 0 => { "disponibilidade":…
-
1
votes1
answer133
viewsGenerate match keys between teams using a PHP array
Opa!! I have the following array on php, need to create a confrontation between teams and teams that are from the same group/array example Time 01 and Time 02 can not face each other in the first…
-
1
votes1
answer29
viewsVector sorting of character vectors with qsort <cstdlib>
The following program is not ordering the chars vector correctly, but I don’t know why. Maybe it’s my auxiliary function "cmpstr" that isn’t returning the right value in some cases, or my qsort…
-
1
votes1
answer631
viewsSend array data in Webservice made in Nusoap
Talk to you guys, blah? I am developing a php webservice in Soap, I am using the nuSOAP library, the tests with simple type were successful but now I need to test with complex types as bad arrays I…
-
1
votes1
answer981
viewsDoubt about how to fill two-dimensional array in Java
I’m doing an exercise and I need help. That’s the statement: Calculate average temperatures for each month. For this, create a list containing the names of each month in the rows, and the number of…
-
1
votes0
answers120
viewsHow to create a filter for a multi-dimensional Mixed array
I have in my POST complex variables with arrays inside other arrays and etc. Behold: $filtro['esms_conta_id'] = 120; $filtro['data_inicio'] = 2016-010-1; $filtro['data_final'] = 2016-010-1;…
-
1
votes2
answers209
viewsOrganize multidimensional array in javascript, preventing the next item from having the same type as the previous one
I have a logic problem here. Let’s see if you can help, because I’m burning neurons here and I haven’t found a starting point. I have an array of objects and need to organize it in a way that the…
-
1
votes1
answer80
viewsBringing Query and Multidimensional Array
I have the need to create an array more or less like in the code below: $documento = array(); $campo = array(); array_push($documento, "1", "CPF"); array_push($campo, "1", "Nº CPF",…
-
1
votes1
answer906
viewsHow to add an array within an array?
$regras = array( array( 'field' => 'cpf', 'label' => 'CPF', 'rules' => 'required' ), array( 'field' => 'senha', 'label' => 'SENHA', …
-
1
votes2
answers292
viewsProblem with recursive function in array
I have a function (which I found here in the forum) that does a search in the array and returns whether it has the value I seek or not, so far so good. Only that a need has arisen, I need to return…
-
1
votes1
answer307
viewsHelp with login system
I’m setting up a login system. But I can’t validate the password entered. When I try this way it accuses wrong login/password. But I’ve made sure, the login and password are correct: <?php…
-
1
votes0
answers492
viewsStore contents of file . txt for a vector and vice versa
Good evening. I need to read a text file and store each book (Struct book) in an array of books. The code has functions to add, edit, delete and view in the array each book. I cannot properly save…
-
1
votes2
answers315
viewsFill missing numbers from a sequence
Hello, I’m putting together a statistical system. The result is an Array with "time" and "views". I need to increment this data with 24 hours a day so that the graph is complete. $sql = "SELECT…
-
1
votes1
answer137
viewsSet associative array key
Consider this array: protected $filter = [ 'preco' => 'required;double(1,4)', 'email' => 'required;email' ]; Step by the foreach: protected function bootFilterPost() { foreach…
-
1
votes1
answer1212
viewsDynamic matrix as parameter in C or C++?
After hours of searching, I didn’t find anything that would answer my question, or I couldn’t understand the answer. I want to create a matrix NxN variable size. I made with pointers,but I want to…
-
1
votes1
answer69
viewsDeclare array in class not knowing it will be its size
How to declare an array within a class, even if you don’t know what size it will be and leave it accessible throughout the program. Note this class: class exemplo{ public: int tx{0}; int ty{0}; int…
-
1
votes1
answer141
viewsError when listing MYSQL data via Restful API with PHP (Ionic 3)
Good morning, I have a problem listing data in Ionic 3 using mysql. The problem is this, I have an app that lists the comforts of a house and the consumption of each room, but I can’t find the…
-
1
votes0
answers38
viewsTrying to program puzzle changing elements into equivalent positions of two error arrays
I’m trying to make a puzzle in which the image comes scrambled into pieces, and by clicking on two different pieces they change position, if the drawing is correct it goes to the next. But the…
-
1
votes1
answer65
viewsFução to find and remove term in the array does not work with variavél!
implementing in my project the user solution Augusto Vasques in the matter : How to remove an array from occurrence found within a sub array! I came across the situation of not being able to search…
-
1
votes2
answers884
viewsPython - how to create a two-dimensional matrix with for loops
Hello The code below gives the following error message: Traceback (Most recent call last): File "C:/Users/Usuario/Documents/tests python/várias.py", line 12, in mult[i][j] = (i*j) Indexerror: list…
-
1
votes1
answer60
viewsArray is only returning the last index
I created an array that has the following structure: $arr = array( "cabecalho" => [ "instrucoes" => array("Instrucao 1", "Instrucao 2", "Instrucao 3", "Instrucao N"), "dadosAluno" =>…
-
0
votes2
answers1994
viewsHow to decode a JSON array [{},{}] on my android
How I turn this string in an array on my Android so I can manipulate it? [{"id":"1","login":"Admin","senha":"Admin","nome":"Admin","msg":"Eba","logado":"0"},…
-
0
votes1
answer368
viewsSave bi-dimensional array to EEPROM memory
I’m making a program for the Arduino written in C++ to turn on and off leds when a button is pressed. I want to save in an EEPROM memory the values of the leds that are connected and the amount of…
-
0
votes2
answers98
viewsCan I put an array as a parameter for another array?
for(i=0; i<=203; i++){ array2[3][i]; array1[array2][2][string]; /*string corresponde a uma string ja definida e nao relevante para a questao*/ (...) …
-
0
votes1
answer1156
viewsChanging sequential values of a multidimensional array
In the framework I develop (PHP language), I use multidimensional array for HTML reporting. There is a particular report that I cannot properly sort in the SQL query, having only all the data by…
-
0
votes5
answers444
viewsPHP array types and values
How I turn that kind of data $pessoas->nome for $pessoas['nome'] and vice versa with php and because they are different?
-
0
votes0
answers99
viewsHow to send only one row of a multidimensional array to a Function?
I need to send only one line of a array multidimensional as a parameter of a Function, without having to transfer this line to another array. for example: calling for: var UmArray : array [0..4,…
-
0
votes2
answers2919
viewsSum of multidimensional array values in PHP
I am building a shopping cart and I am using Sessions to save the products from the cart. The array structure that saves items is as follows: $_SESSION['carrinho'][ID_DO_PRODUTO;TAMANHO_SE_HOUVER]…
-
0
votes2
answers615
viewsHow to find out if an array is multidimensional or not in PHP?
I have these two arrays down below: $a = [1, 2, 3]; $b = [1,[2, [3, 4]]]; I know that $a is a array one-dimensional, and $b, multidimensional (array of arrays). Now, how could I discover, through a…
-
0
votes1
answer180
viewsSep::Sort Cakephp array
I need to sort an array in cakephp according to the order passed by parameter. The code that makes the ordering would be this: //Realizar a ordenação de acordo com o que receber do formulário no…
-
0
votes1
answer367
viewsGrab file names and put in char array
As I take the filenames of a directory and place them in a multidimensional char array? #include <stdio.h> #include <dirent.h> int main() { char arrayNomes[10][50]; char dirn[50]; DIR…
-
0
votes1
answer1173
viewsHow to mount an array with Std::array and Std::vector in C++11?
How to mount an array with Std::array and Std::vector in C++11 ? What is the difference between the two architectures? How to scan this array with C++11?
-
0
votes1
answer70
viewsCreate array and count values
I’m having a really hard time drawing a array in PHP with the following data coming from an object JSON, no, it does not come from a database SQL query. Example of JSON: [ { "data": { "ID": "349",…
-
0
votes2
answers121
viewsCreate an array separated by date groups
People want to create a separate array in groups by date of the result of a query made in DB example: // [...] $sql = $this->db->query($query) or die (sprintf("Falha: %s",…
-
0
votes1
answer533
viewsHow to use Foreach in a multidimensional array in PHP
I would like to know how to run the entire array only with Foreach: $Marcas = array(array('Fiat', 'Volkswagen', 'Audi'),array('Yamaha', 'Suzuki', 'Honda'),array('Samsung', 'Motorola', 'Apple'));…
-
0
votes0
answers215
viewsUnify Multidimensional Array in only 1 array in PHP
Is it possible to transform a Multidimensional array into just 1 (one) array in php? What would the process be like to do this? In the image below, I need to transform the array on the left side so…
-
0
votes1
answer198
viewsIterating on a multidimensional array
<?php $data = array(); //questoes de user 1 $data['rows']['questions'][1] = array( array('id' => 1, 'type' => 'radio', 'name' => "Onde fica ilha de Santiago"), array('id' => 2, 'type'…
-
0
votes2
answers115
viewstransform string into multidimensional array
I have the string down and I’ve tried to turn it into a Multidimensional array but I don’t know how to do it, another problem I can’t solve is the spaces, even using a explode they remain in the…
-
0
votes1
answer150
viewsCreate a multidimensional array in Java table format?
I’m a beginner in Java and have doubts how to create Multidimensional Array, I have the table below How do I create a Multidimensional Array from this table?…
-
0
votes1
answer25
viewsReplace string by image
I am making a game board and when I try to replace the blocks with pictures, it returns me a block with the image and the identification string of that block. I intended to completely replace the…