Questions tagged as 'array'

1
answer

String for Array / List

I have the following String: [{"Monstro":"Lobo","HP":100,"Level":2},{"Level":"1","HP":"100","Monstro":"Bruxa"}] You need to put it inside a Array ou List to get the values of each monster. How do I do this? Sorry if the ques...
asked by 02.12.2017 / 01:12
1
answer

Array in white - only removing half of them

I have the following array: Array ( [0] => Array ( [Produto] => ENH1264-1 [Quantidade] => 1 ) [1] => Array ( [Produto] => ENH1264-3 [Quantidade] =&...
asked by 07.12.2017 / 20:46
1
answer

Assigning values to a numerical array of values a query in PHP

Given the marcas table of the teste_db database (for example) | id | marca | | 1 | mercedes| | 2 | audi | | 3 | fiat | | 4 | alfa | | ...| ... | |573 | ferrari | |574 | bentley | and given an array with...
asked by 07.12.2017 / 13:15
1
answer

Receiving data from an observable

I have a problem using an observable. While I'm inside the NgOinit method, when fetching the data, I get the array correctly and hedge in the class variable. However, when I try to access the data outside the subscribe, I get undefined in respon...
asked by 20.11.2017 / 12:37
1
answer

Split an array into new arrays with character limit in each of the array

My problem is this: I have the input string: "A|BB|CCC|DDDD|EEEEE|FFFFFF|GGGGGGG" . I need to split this string in the "|", so that in the case it divides in 6. But I need each value to be in an array of 10 characters or more and the...
asked by 24.10.2017 / 22:41
1
answer

How do I pass an array in HTML attributes and not show single quotes?

Following this post I've created the following html passing arrays as an input element attribute: ... <input type="text" name="setValues[cardExpiration]" id="card_expiry" class="input-small" value="1222"> <input type="text" name="se...
asked by 24.10.2017 / 14:56
1
answer

How do I check if a value already exists in my array?

My array has the structure below, before adding a new position, I would like to check if the "product_id" already exists and if "qtd" is still the same, I tried the community answers but I did not succeed. p> Array ( [0] => Array...
asked by 19.10.2017 / 14:59
1
answer

Define associative array key

Consider this array: protected $filter = [ 'preco' => 'required;double(1,4)', 'email' => 'required;email' ]; Step by foreach: protected function bootFilterPost() { foreach ($this->filter as $key => $value):...
asked by 05.10.2017 / 12:37
1
answer

Note1 and nota2 report errors and do not display storage in the array. Can anyone help? Thank you very much

namespace mediaDe5Alunos { class Program /*faça um programa para cálcular a média de duas notas de 5 alunos, mostrar a média da sala e de cada aluno e um relatório dos alunos*/ { static double calculo (double nota1, double not...
asked by 03.10.2017 / 18:33
3
answers

Printing times with predetermined intervals

I'm trying to make a code that will print the hours at a given interval. <?php //Array com os horarios que possam ser imprimidos $hora = array('13:55:40','13:56:40','13:58:41','13:59:40','14:01:00','14:02:00','14:04:40', '14:05:00','14:07:...
asked by 23.11.2017 / 19:58