Questions tagged as 'array'

1
answer

Empty vector displays the end result of the function

I'm doing tests with array / vector and as the first vector display should be shown empty, as second, would come full. What's the problem, why does it occur? And how can I fix it? <ul><li>Murilo</li><li>Mariana</li>...
asked by 26.05.2017 / 15:26
2
answers

Array sorting based on the order of another array

Next, I have two vectors each with a numeric sequence. Let's call them Array1 and Array2 . The values are below ... Array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; Array2 = [7, 6, 3, 9, 4, 5, 1, 10, 8, 2]; My question is ho...
asked by 17.04.2017 / 13:21
1
answer

How to check if an array has an attribute?

I'm using Laravel 5.4 in an application, and a validator method gets an array . This array can have the attributes: [ 'nome' => $request->nome, 'ddd' => $request->ddd, 'fone' => $request->fone ] Or jus...
asked by 16.02.2017 / 16:08
1
answer

Create dynamic inputs from a json object

I have a form that the user can add several languages that knows how to speak, this form consists of a dropdown and a button to add the respective language. At the moment I click the add button it adds me new object to an array, as I show in the...
asked by 10.02.2017 / 16:44
1
answer

How to create nested array from information received via POST

Given the array below: $aDup = array( array('35342-1','2016-06-20','300.00'), array('35342-2','2016-07-20','300.00'), array('35342-3','2016-08-20','300.00'), array('35342-4','2016-09-20','300.00') ); I created something like...
asked by 06.01.2017 / 20:18
1
answer

Add item with different array

I have the following array () Array ( [nome_responsavel] => [telefone] => [email] => [dependentenome] => Array ( [0] => qqq [1] => qqq [2] => qqqq )...
asked by 10.01.2017 / 21:21
1
answer

Add multiple indexes of a vector as parameter

I'm starting in JAVA. I created two classes, the Pessoa class, which receives the following parameters in instantiation of a new object: public Pessoa(String nome, int idade, char sexo) And the class Livro : public Livro(Stri...
asked by 23.01.2017 / 16:58
1
answer

Invert display of Xml in PHP

How do I reverse the display of an xml in PHP? Code: $xml = simplexml_load_file('link.xml'); foreach($xml->VERSAO as $versao) { ?> <tr> <td width="10%"><center> <?php echo $versao->VERTEXT ?> </center>...
asked by 08.12.2016 / 20:10
1
answer

Bringing Query and Array Multidimensiobnal

I have the need to create an array more or less as in the code below: $documento = array(); $campo = array(); array_push($documento, "1", "CPF"); array_push($campo, "1", "Nº CPF", "000.000.000-xx"); array_push($campo, "2", "NOME TITUL...
asked by 12.12.2016 / 20:17
2
answers

Converting a vectorstruct in C ++ in C

I'm trying to adapt a C ++ function in pure C. I changed the names of the variables and structs because it is not the case. typedef struct struct1 { int a; int b; int c; string d; } STRUCT1; typedef struct struct2 {...
asked by 18.11.2016 / 00:44