Questions tagged as 'array-multidimensional'

2
answers

How to find out if an array is multidimensional or not in PHP?

I have these two arrays below: $a = [1, 2, 3]; $b = [1,[2, [3, 4]]]; I know that $a is a% one-dimensional%, and array , multidimensional (arrays array). Now, how would I find out, through a function, that I returne...
asked by 12.08.2016 / 20:16
2
answers

Create a separate array by date groups

I 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", $this->db->error())); if ($sql->num_rows) { while ($ro...
asked by 13.01.2016 / 12:44
1
answer

Save two-dimensional array into EEPROM memory

I'm doing a program for Arduino written in C ++ to turn on and off leds when a button is pressed. I want to save the values of the LEDs that are on and the amount of brightness in an EEPROM memory. I thought of using an array, so the first el...
asked by 08.08.2014 / 16:33
1
answer

Picking indexes with equal keys from a non-associative array

How do I get / group indexes with equal keys in an array, for example: Array ( [field_label] => Array ( [0] => Texto [1] => Checkbox [2] => URL ) [field_type] => Array...
asked by 12.08.2018 / 19:57
1
answer

Create Array using result of a SELECT

public class TelaGrafico extends javax.swing.JFrame { Connection conexao = null; PreparedStatement pst = null; ResultSet rs = null; /** * Creates new form TelaGrafico */ public TelaGrafico() { initComponen...
asked by 18.01.2018 / 14:41
1
answer

How to use ForEach in a multidimensional array in PHP

I would like to know how to run the entire array with ForEach only: $Marcas = array(array('Fiat', 'Volkswagen', 'Audi'),array('Yamaha', 'Suzuki', 'Honda'),array('Samsung', 'Motorola', 'Apple'));     
asked by 07.06.2018 / 23:13
1
answer

Create array and count values

I'm having a hard time drawing a array in PHP with the following data coming from a JSON object, no, it does not come from a SQL query in a database. Example of JSON : [ { "data": { "ID": "349", "use...
asked by 26.03.2018 / 15:54
2
answers

Concatenating items of an Array in a nested loop

I would like to get the items in var a , a two-dimensional Array, and iterate in a nested loop, concatenating everything, to put them in brackets, separated by a slash, as shown by the desired result logo below, which will be stored in...
asked by 22.01.2018 / 02:17
1
answer

I can not get an Array

I'm trying to get a value inside an array, but it does not print anything from the id field, which is the field I want to get $jsonc = file_get_contents("https://api.themoviedb.org/3/search/tv?query=todo%20o%20mundo%20odeia%20o%20chris&api...
asked by 22.11.2017 / 17:57
1
answer

Array_push in multidimensional associative arrays in php

I started an array ($ arrDados = array ();) and now I need to add information (array_push) so that I can access the information later as follows: colA1 = $arrDados['NumeroEmpenhoAno']['code']; colA2 = $arrDados['NumeroEmpenhoAno']['size']; co...
asked by 21.05.2017 / 03:48