Questions tagged as 'array-multidimensional'

1
answer

Data returned in an array is duplicated

I'm running a SELECT in the database through a function and returning the result as a multidimensional array, where each primary index refers to a record, and the secondary indexes are the bank fields with the values. Below is the function re...
asked by 08.03.2018 / 14:07
2
answers

Check string is contained in PHP Array

I have a function in cURL, its return is an indefinite amount of data, but its format is standard. Return: array(86) { [0]=> array(2) { ["value"]=> int(1) ["data"]=> string(27) "retor...
asked by 12.08.2017 / 23:59
2
answers

Difference between two Multidimensional Arrays with PHP

I have these two multidimensional arrays and would like the difference between them, similar to what the array_diff function does, but with multidimensional arrays: $array_1: Array ( [0] => Array ( [...
asked by 19.07.2014 / 23:28
3
answers

Search for word in the first array column [closed]

How do I search for a word in all rows, but only in the first column of an array that will always increase in size? string[,] array = new string[1,6]{{"texto","","","","",""}}; if(array[array.Length, 0].Contains("texto")){...
asked by 17.10.2016 / 00:26
1
answer

Set values of an array recursively

Assuming I have the following array array( 'chave1' => 'valor1', 'chave2' => array( 'chave3' => 'valor2', 'chave4' => array( 'chave5' => 'valor3' ) )) And in this array I need to set the value of key 5, bu...
asked by 14.06.2015 / 23:40
1
answer

How to sum array data in json specified by date

array(10) { [0]=> array(4) { ["data"]=> string(10) "01/11/2015" ["valor"]=> int(50) ["intensidade"]=> float(37.5) ["carga"]=> int(35) } [1]=> array(4) { ["data"]=> string(10)...
asked by 31.10.2015 / 22:05
1
answer

Depth Array

I have an a1 Array a1=[a2[a3[a4[]],a5]] I need to know the depth of the array in this case is 3 because in the array a1 has the array a2 and inside of a2 has a3 and inside a3 has a4, that is 3 levels deep. The depth changes from array to...
asked by 30.05.2014 / 00:04
2
answers

Is it possible to use Heredoc with special characters in an array?

I have a multidimensional array, as the example below shows, but I wonder if I can use a Heredoc in it, would it be possible? Could I include special non-escaped characters if I can use Heredoc ? $name_code = array ( array("Nome", "HER...
asked by 06.08.2016 / 18:38
2
answers

Use array_search in a multidimensional array php

In a list of books within a% multidimensional%, every array has a different column category , I would like to search this sub_array for a category > for example: Array "livros" ( [Livro 1] => Array...
asked by 19.11.2016 / 00:45
1
answer

Problem with login system - array

Hello. I'm creating a login system for study purposes. I have identified in the file that is not populating the array with the information of the database ... and yes, I already made sure that the entered email and password already exists in...
asked by 03.01.2017 / 23:23