Questions tagged as 'array'

1
answer

Sort Array with PHP to generate a list of multilevel menu

I'm trying to generate a multilevel menu listing in PHP but I have not managed to do it, I would like to help me with simple examples and sort the Categories and Sub categories with their title, something like this: Category 1              ...
asked by 12.07.2017 / 02:44
1
answer

How to create an array of n positions, C ++

My question is how to declare an array without specifying the length and then instantiate it in the constructor method by specifying the quantity. To enter the context, I leave the following example. #ifndef GRAFO_H #define GRAFO_H #include...
asked by 16.07.2017 / 18:57
1
answer

How to prevent me from printing garbage from an array?

My program read a text from a .txt and saves it in the text [TAMTEXTO] character by character, then in the separatewords () function; I separate the words with a if condition, if you find a space save the word in a two-dimensional arrangem...
asked by 27.06.2017 / 05:06
2
answers

Call an element of an array whose element name is in a variable

Suppose we have the following: in data I have the values title, first names, last name and I have an array with the following elements person [0]. title, person [0] .names, person [0]. lastname I use a for as follows: for...
asked by 10.08.2017 / 23:52
1
answer

Create an object with a normalized structure

I have a service that returns an object like this: [ {id: 1, name: 'Pedro', city:1, state: 1, country: 1}, {id: 2, name: 'Juan', city:12, state: 2, country: 1}, {id: 3, name: 'Ana', city:10, state: 5, country: 1}, {id: 4, name: 'Diego', city:7...
asked by 08.06.2017 / 22:41
1
answer

How can I show a separate string array and its values?

I am working with mulestudio and I have a string that is large and I made an arrangement of it since when I call the string to print it or it gives me errors or it shows me all messy and what I want is to show each variable with its value separa...
asked by 06.06.2017 / 16:39
2
answers

Compare positions of an array $ miarray [n]

How could I validate the values of the same array, that is, for example: if ($miarray[0] < $miarray[1]) { //$miarray[0] toma el valor de $miarray[1] } if ($miarray[2] > $miarray[3]) { //$miarray[3] toma el valor de $miarray[2] }...
asked by 16.05.2017 / 16:58
3
answers

Use of accumulators in matrix element and iteration counter in Do..While

Hi, I'm learning Javascript and I've come across this: var depositos=[]; var nro,monto; do { nro=prompt('Ingrese nro de cliente',''); nro=parseInt(nro) if (nro!=0) { monto=prompt('Ingrese monto a depositar','');...
asked by 26.04.2017 / 18:55
2
answers

Obtain PHP object data but it has a json array at the end

Good evening, I have a problem trying to get the answer from the webservices of afip. I send a request to the ws of afip and it returns me the following. I want to get the error but if you see it, the WS response is a stdclass and below...
asked by 08.04.2017 / 04:36
1
answer

PHP - Sort and group values of a multidimensional array by uploading multiple files

I have the following form that when sending it with multiple images, it generates a multidimensional array with all the data ordered by default. HTML and PHP form: <?php if(array_key_exists('send', $_POST)) { echo "<pre>"; p...
asked by 07.05.2017 / 18:49