Questions tagged as 'array'

1
answer

How to do list all of xml to php

Good evening. I have the following xml file: <MusicHistory CompactMode="1"> <Item0 Block="2018-02-11T23:00:00" Folder="Musicas" Music="Zara Larsson - So Good" Composer="" Comment="" Start="2018-11-03T02:19:13.000Z"/> <Item1 Bloc...
asked by 03.11.2018 / 03:25
3
answers

Doubt - Array php return [duplicate]

I'm new to php , and I came across the following problem. I have a function that returns an array that comes from the database. $teste = dados($conexao); And I do: print_r($teste); It returns me the following data: Array (...
asked by 26.09.2018 / 16:36
1
answer

Join two array in php

Good morning guys, a quick question. I need to merge two array of a query as follows: $tamanhos = array('p', 'm', 'g'); $valor_item = array('10', '20', '30'); where "p" has to be equal to 10, m = 20, g = 30 This can make a foreach that b...
asked by 15.09.2018 / 16:36
1
answer

Group the values of a PHP array according to the same key.

Good afternoon guys, I know the question may seem repetitive, but I'm already looking for the solution to my case, especially here in #stack. I have the following Array () : array (size=9) 'Janeiro' => array (size=54) 0 => ar...
asked by 18.09.2018 / 22:57
2
answers

Larger number of occurrences of an element in an array of objects - JavaScript

Hello, I have an array of news (objects) lista: Array<Noticia> = []; From this array I need to find out the author who most published the news. One news item has: ID | Title | Tags Author | Content . My initial idea was:...
asked by 17.09.2018 / 18:20
2
answers

Combine arrays within array

Someone can help me, please. I have an array in this style: $arrayTable = array( 0 => array( 'idApiUm' => 123, 'title' => 'Teste' ), 1 => array ( 'idApiDois' => 765, 'title' => 'Título'...
asked by 27.12.2018 / 17:45
1
answer

Use PHP array and bring results in several lines

I have an array $_POST['form']['clima'] which in this example has the value below array(2){ [0]=> string(1) "1" [1]=> string(1) "2" } I need to get these values to join with $ id (in this example it will be 3) to bring the resu...
asked by 20.10.2018 / 00:34
2
answers

Concatenating multiple lists with Python

Good afternoon! I have a problem and need help, I'm working with 3 distinct lists that should be added to a dictionary, but so I can capture all the values without one overwriting the other, I need to concatenate those 3 lists. I know that us...
asked by 08.08.2018 / 20:14
1
answer

Slice an array

I'm having problems with the values of x2 when trying to slice to display in graphic 2 nothing appears and I can not see where I'm going wrong? import matplotlib.pyplot as plt import numpy as np xold = np.random.rand() N = 3000 x1 = np.empty...
asked by 06.11.2018 / 21:12
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