Questions tagged as 'array'

1
answer

Transform string into array excluding repeated values

In PHP I made a script that takes every word of a tring and transforms them into an array, giving explode in the empty spaces. Then it deletes the repeated words and shows each of them, like this: <?php $hashtag = "#caio #azul #caio #azul #...
asked by 06.08.2018 / 21:10
1
answer

Add values from an array of different criteria each

0 : {idPVI: “10”, idPV: “3”, descri: “Portuguesa”, preco: “32” } 1 : {idPVI: “10”, idPV: “3”, descri: “Portuguesa”, preco: “32”} 2 : {idPVI: “13”, idPV: “3”, descri: “Calabresa”, preco : “35”} 3 : {idPVI: “11”, idPV: “5”, descri: “Bord...
asked by 27.07.2018 / 22:09
1
answer

Store values in vector

I have an exercise on vetores/array with simple value, where I must correct a test, comparing it with the feedback and still calculate the percentage of the students that reached the average.    6) Make a program to correct multiple ch...
asked by 10.08.2018 / 14:14
2
answers

Save the data from the array, not its key

Galera blz ..., I am editing a field to save in db, I send pro edit.ctp the following array $result = array_merge($cones->toArray(), $cda->toArray()); debug($result); // Result: [ (int) 0 => 'Valor 1', (int) 1 => 'Valor 2',...
asked by 25.07.2018 / 18:35
0
answers

How to compare arrays and datagridview through loops?

Good afternoon guys I have 7 textboxes that I did this way long[] Jornada; Jornada = new long[7]; Jornada[0] = TimeSpan.Parse(textboxjornadaseg.Text.ToString()).Ticks; Jornada[1]= TimeSpan.Parse(textboxjornadater.Text...
asked by 27.07.2018 / 18:12
1
answer

Delete a key from all arrays if it is null or blank

Array ( [0] => Array ( [Foto] => imagem.jpg [Código] => 311102 [Tipo] => Meu tipo [Cidade] => Araçatuba [Valor] => [Mais Info] => Todos jun...
asked by 04.08.2018 / 04:08
0
answers

Mount array with result of two querys

Good evening. I need your help. Sequinte ... I'm setting up a function that does a query in the cardapio table, I pass the result of that query to an array, then I make a foreach with that array. Inside this foreach I make a second query in t...
asked by 19.07.2018 / 01:53
1
answer

How to store a word within a vector with a size larger than the word

I declare a char SendDataCmd[256] variable that will store commands sent from the computer to the microcontroller via UART . The commands have different sizes such as RST, ADV ON e SET SNAME=BC118 among others. I have a funct...
asked by 19.07.2018 / 14:31
1
answer

How to remove line break from txt file in PHP array

I have a txt file extracted from a PDF. I upload this txt via php, and I need to remove the line break between the items in the description and put in an array, it follows: ORIGINAL TXT: 0235.000001-4 0235.213.00001295-8 'DUAS ALIANÇAS, NO...
asked by 19.07.2018 / 13:21
1
answer

Return Ids searching for the value of a multidimensional array

Is there any way without using foreach , using only native PHP functions to return an array with the ids fetching all that are with the value 'a'? Example: $lista = array( array( 'id' => '100', 'name' => 'Sandra S...
asked by 11.07.2018 / 22:27