Questions tagged as 'array-multidimensional'

2
answers

Problem 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 if it has the value that I search or not, so far so good. Only a need arose, I need to return the position number he found, as it returns only -1, so...
asked by 05.01.2017 / 14:07
1
answer

How to remove the red part of the figure?

require("setup_do_banco.php"); $colunas = $pdo->prepare("SELECT * FROM origem WHERE ativado = 1"); $colunas->execute(); while ( $coluna = $colunas->fetchAll(PDO::FETCH_ASSOC) ) { $array_banco = $coluna; } foreach($array_banco as $...
asked by 28.12.2014 / 17:02
2
answers

Select an array based on the value of an internal key

I have the following array: Array ( [ajax.js] => Array ( [name] => ajax [fileName] => Web/js/App/ajax.js [file] => ajax.js [path] => Web/js/App [parent_path] => App [exten...
asked by 13.03.2014 / 14:27
1
answer

Bringing Query and Array Multidimensiobnal

I have the need to create an array more or less as in the code below: $documento = array(); $campo = array(); array_push($documento, "1", "CPF"); array_push($campo, "1", "Nº CPF", "000.000.000-xx"); array_push($campo, "2", "NOME TITUL...
asked by 12.12.2016 / 20:17
2
answers

Arrange 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 have not found a starting point. I have an array of objects and I need to organize them in a way that the previous item can not be the same as the...
asked by 23.11.2016 / 03:56
1
answer

Receive array values

How do I get the values for this checkbox? <input type="checkbox" name="Item[<?php echo $IDCatalogo; ?>][<?php echo $IDItem; ?>]"> foreach( $_POST['Item'] as $key => $n ) { print "<p>".$n." | ".$key....
asked by 19.09.2015 / 20:39
1
answer

Nest keys in an array in a Javascript object

How to create a javascript object nested from a literal array? I have the following array: var x = ['a','b','c']; From the array 'x' I would like to generate the following object: var y = {a:{b:{c:{}}}}; So far I've tried iterating...
asked by 24.06.2015 / 21:54
1
answer

Changing values of a two-dimensional array - PHP

Hello. I need to mount a foreach to update the array values below: Array ( [0] => Array ( [id] => 1 [profissao] => Ajudante de cozinha [interesse] => ) [1] => Array...
asked by 09.02.2015 / 23:39
2
answers

Can I put an array as a parameter of 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*/ (...)     
asked by 04.12.2014 / 00:07
1
answer

Declare array in class not knowing what its size will be

How to declare an array inside a class, even though it does not know how large it will be, and make it accessible throughout the program. Note this class: class exemplo{ public: int tx{0}; int ty{0}; int array[tx][ty]; // se eu tentar d...
asked by 29.05.2018 / 19:45