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
-
0
votes1
answer630
viewsVector sorting of character vectors with qsort <stdlib. h>
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…
-
0
votes1
answer182
viewsForeach and multidimensional associative array with only one item
All right guys, I am facing a problem with foreach in PHP, in which I receive an xml and convert it to array. Only that in some cases xml has only one item (See the example below) <?xml…
-
0
votes1
answer623
viewsAdd values from an array
I’m trying to make this code, which is basically a six-by-six two-dimensional array with the distance between six cities, then collect the route that the user did in a simple array [6], and…
-
0
votes1
answer449
viewsArray_push in php multidimensional associative arrays
I started an array ($arrDados=array();) and now I need to add information (array_push) so that I can access the information later on as follows: colA1 = $arrDados['NumeroEmpenhoAno']['code']; colA2…
-
0
votes1
answer27
viewsI can’t get an array
I’m trying to get a value inside an array, but it doesn’t print out anything from the id field, which is the field I want to pick up $jsonc =…
-
0
votes1
answer475
viewsCreate Array using SELECT output
public class TelaGrafico extends javax.swing.JFrame { Connection conexao = null; PreparedStatement pst = null; ResultSet rs = null; /** * Creates new form TelaGrafico */ public TelaGrafico() {…
-
0
votes2
answers283
viewsConcatenation of items from a nested loop array
I would like to pick up the items in var a, a Bi-dimensional Array, and make an iteration in a nested loop, concatenating everything in order to place them between brackets, separated by a bar, as…
-
0
votes0
answers489
viewsFunction to multiply each row of a matrix by the value of its corresponding secondary diagonal
I’m not getting the values of the secondary diagonal of a matrix by a function. /* 19) Elabore uma sub-rotina que receba como parâmetro uma matriz A(6,6) e multiplique cada linha pelo elemento da…
-
0
votes1
answer91
viewsPicking indexes with equal keys from a non-associative array
How do I pick/group indexes with equal keys of an array, example: Array ( [field_label] => Array ( [0] => Texto [1] => Checkbox [2] => URL ) [field_type] => Array ( [0] => text [1]…
-
0
votes2
answers117
viewsPicking up javascript arrays for sending in the form
<script type="text/javascript"> var nomess = []; function handleFileSelect() { var output = document.getElementById("resultt"); arquivos = $("#imagem").prop("files"); var nomes =…
php javascript array multidimensional-array array-pushasked 5 years, 9 months ago Richard Barcelos 21 -
0
votes4
answers712
viewsHow to access only the first position of each row in an array of arrays (matrix / multidimensional array) using foreach?
I have a array multidimensional / array of arrays / matrix (as you prefer to call): public string[,] operacoes = { { "SOMA", "", "" }, { "SUBTRAÇÃO", "", "" }, { "MULTIPLICAÇÃO", "", "" }, {…
-
0
votes1
answer29
viewsProblem when creating Multidimensional Array with Jquery
I need to create an array this way: "M":["02328280006985",{"61","63"},],"NM":["02328280007876",{"62","64"}]} but it’s coming out that way:…
-
0
votes0
answers55
viewsCreate Multidimencional Array Dynamically in PHP
Perhaps that question has already been asked but I have found nothing to help me. I believe that this doubt is simple but since I am no expert in PHP, I could not solve it. Following: In the company…
-
0
votes1
answer60
viewsHow to remove an array from occurrence found within a sub array!
Well, I have the following situation, I would need to check if the term exists (name of the fruits) if to delete the array that is matching the values (name of the fruit and code) Example: When…
-
0
votes1
answer55
viewsHow do I make a multidimensional array return by ajax
good morning, I have the following code (this working), it returns me to Ajax an array with integers. <?php date_default_timezone_set('America/Sao_Paulo'); require_once '../conexao/conexao.php';…
-
0
votes1
answer34
viewsHow to group two indexes in a tuple?
I want to group two indices that are received from positions that are results of if’s/Elif’s def MakeListOfFreeFields(board): n_rows = len(board) n_cols = len(board[0]) tfields = () for row in…
-
0
votes1
answer40
viewsQuestions about C-language loop/array
Hello! I did a basic program to calculate the averages of 4 students. The problem is that the result of it, in the final screen, appears the phrase "Insert 4 Notes student 5 here: " without having…
-
0
votes1
answer28
viewsHelp with PHP Multidimensional Array?
I’m reading some API, and faced a situation with array, that I’m having a little trouble, I searched a lot in the forum before asking, however, as I have little experience I’m breaking my head. The…
-
0
votes0
answers34
viewsHelp with PHP multidimensional and foreach array
all right with you guys? I’m studying PHP programming and mainly reading Apis, I came across the.com ticket api for reading movies and sessions, I’m managing to capture the sessions of a certain…
-
0
votes1
answer37
viewsHow does the diagonal sum printf of a matrix
I’m having a hard time creating a printf that depends on the input. I want you to print depending on how many numbers you have diagonally in a matrix and display those numbers. EXAMPLE: You must…
-
0
votes1
answer27
viewsHow do I get the spaces just from the last column of the matrix?
Iai galera, so my code is already working perfectly, but in the last column it also gives a space, but I do not want this space there, as I do to remove it? Leaving only spaces between numbers.…
-
0
votes1
answer77
viewsBINGO game in C , Using matrix with 3 dimensions?
How can I generate some (detail: plural) random cards with numbers, but need to manipulate them as a three-dimensional matrix. Cartela[players] [n] [n] .. n = The dimension My program generates only…
-
0
votes1
answer21
viewsHow to go multidimensional picking up key and value?
Hello I have a multidimensional array and I need to go through all levels $items = [ 'janeiro' => [ 'alimentos' => [ 'item1' => 100, 'item2' => 50, 'item3' => 200, ], 'limpeza' =>…
-
0
votes2
answers43
viewsHow to pass product information with parameters and pull in shopping cart?
i am new in the programming area and am creating an Ecommerce, until I came across the following situation when submitting my form via ajax. Items sold on the site have parameters, for example: The…
-
-1
votes1
answer225
viewsSave user input to a loop
I want to get the variable list numeros, generated by the following loop: Scanner kb = new Scanner (System.in); double [] numeros= new double[10]; for (int i = 0; i < numeros.length; i++) {…
-
-1
votes1
answer236
viewsDeclare a two-dimensional array in javascript with no position number specified
As you create a two-dimensional array in javascript where you don’t need to put a specific size, and it keeps growing as I add things.
-
-1
votes1
answer338
viewsDoubt: Scroll through a PHP Laravel multidimensional array
How to Optimize Traversing Data from the Laravel Multidimensional Array in the Controller and The Result Reflected in the View. Example:…
-
-1
votes1
answer212
viewsGroup values from a multidimensional array with the same value and display in a table
Good morning, I have a multidimensional array, shown below: array(3) { [0]=> array(1) { [0]=> object(stdClass)#35 (3) { ["id"]=> string(2) "73" ["valor"]=> string(6) "200.00"…
-
-1
votes2
answers837
viewsAdd an array inside another already created Javascript
I can create an array within another as follows: var meuArray = [["1","2","3"],["4","5","6"]]; With this I can easily check the positions just by calling meuArray[x][y], where x is which array I…
-
-1
votes1
answer275
viewsError in exchange for elements in the matrix
I’m trying to exchange two position elements in this matrix. After some changes, the elements begin to exchange among themselves in an apparently random pattern. Could someone identify me the…
-
-1
votes1
answer155
viewsPHP Mysql multidimensional array
I’m having a little trouble assigning an index to encompass the items marked in the figure below in a multidimensional array I’m mounting with the database queries: I need to take from another table…
-
-1
votes1
answer387
viewsHow it shows the row and column position of a matrix in C and sums the row and column
Good afternoon Guys!!!! I know the question seems silly, but I’m starting now in programming needed to do a C program with a MATRIX[4][4] as described here below. I’ve been trying for a few days,…
-
-1
votes1
answer26
viewsOrder products (Array)
Good morning, I have the following lines of code to return an order listing with the respective products. Products is an object within requests in the comic book. {transactions.map((order) => {…
-
-1
votes1
answer55
viewsHow to create a multidimensional array in c++?
I have a matrix float m2D[4][4]. For the purposes of my program, I need at the same time to change the values in the components of m2D be able to save the status prior to that change. It’s basically…
-
-2
votes1
answer25
viewsProblem handling foreach in a PHP array
I’m trying to go through the transaction of the following array but without success: Array ( [date] => 2021-08-07T20:48:14.000-03:00 [transactions] => Array ( [transaction] => Array (…
-
-3
votes1
answer429
viewsUpdate with Multidimensional Array
I’m having a terrible problem, I can’t update mysql via PDO, with array that comes from some form fields. I’ve tried a lot and so far I can’t update. The array comes in this format. Array ( [id]…
-
-3
votes2
answers352
viewsRead JSON multidimensional array via PHP
Gentlemen, I’m having difficulty reading a JSON that comes via API, I receive it in the following way: $json_file =…
-
-6
votes2
answers208
viewsPHP - associative array: check the amount of elements within a value (which has an array) of a key
I have an array like this: $array = array( user => "user1", name => "name1", books => "book1", "book2" ); I want to go in Books and check the value that elements have inside it, in case it…