Questions tagged as 'array'

2
answers

Convert URL to Object (JavaScript)

I am working on a personal project (using node.js) where I need to get the route of the GET request, for example "/path/to/content" , transform it into an Object and make it look like this: { "path": { "to": { "content":[...
asked by 27.12.2018 / 17:49
4
answers

Sort array php kb, mb, gb

I have an array that filled with a query. What I get is the following: array (size=9) '128 GB' => array (size=1) 0 => string '156' (length=3) '16 GB' => array (size=2) 0 => string '106' (length=3) 1...
asked by 09.11.2016 / 20:26
1
answer

How to add the elements of Array?

Hi, I am trying to create a program that adds the multiples of 3 and 5 that are between 0 and 10. Well, I do not know what I'm doing wrong that the sum gives me 33, when it should be 23. Do you see the error in my code ...? Thanks. funct...
asked by 14.05.2018 / 00:43
1
answer

Doubts about pointer arrays

I have a doubt between the behavior of two arrays declarations. And it is not related to the dynamic allocation of memory, but how to access the objects of the array. I explain. Case a: Suppose I define an array in the following way. Ti...
asked by 30.04.2018 / 12:49
1
answer

Store query in array

Very good to everyone. I need to solve something that I can not give with it. I have a mysql query where I extract the income totals for each month of the year 2018. $sql_g=mysqli_query($con, "SELECT MONTH(fecha_factura) AS mes, SUM(total_vent...
asked by 05.05.2018 / 18:58
2
answers

Array to PHP table

I have the following array: Array ( [0] => Ficha 001 [nombre] => Ficha 001 [1] => Supermercados [matriz_nombre] => Supermercados [2] => 1000 cc [columna_nombre] => 1000 cc [3] => Heineken [fila_nombre] => Heineken [4] =...
asked by 22.10.2018 / 14:17
2
answers

One-dimensional arrays in C ++

What are the one-dimensional arrangements for? int Temp[12];     
asked by 10.04.2018 / 16:08
2
answers

Print field of an array in Angular

I have a function in Angular that brings an array with user data, among which one field is user.type_identity_id, and I have another function where I bring the types of identities, how can I compare and according to the user.type_identity_id pri...
asked by 10.04.2018 / 16:55
2
answers

Extract 4 random Strings from an Array in JavaScript

How could I extract 4 strings randomly from an array, for example this var myArray = ["Rufles Original", "Aceitunas", "Lays al punto de sal", "Doritos TexMex", "Nachos", "Aceituna maceradas", "Rufles Jamon Jamon", "Cerveza", "Coca-...
asked by 07.09.2016 / 13:16
2
answers

Save the contents of an array in a .txt using PHP foreach

I'm looking for how to save the contents of an array in .txt: <?php $resul = array('hermaniribeiro', 'Ebtsama', 'BrittoOFC', 'CheesterG', 'dsolutec', 'ExpoGanSon', 'dsolutec', 'ExpoGanSon', 'dsolutec', 'BelforFx', 'kunakrec', 'YouTub...
asked by 30.09.2017 / 04:20