Questions tagged as 'array'

2
answers

SQL query with PHP array [duplicate]

I have an array that will be variable, eg $ ref = array ('123', '654', '555'). I wanted to do a SQL query to bring information from these references, something like: SELECT * FROM tabela_itens WHERE ref = (array do PHP) How can I do th...
asked by 02.05.2018 / 19:56
2
answers

Create worksheet by adding images and changing line color

This method creates an Excel spreadsheet, with int and string : public function arrayToXls($input) { // BoF $ret = pack('ssssss', 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); // array_values is used to ensure that the array is n...
asked by 17.03.2015 / 14:00
4
answers

How to access index of a javascript array

When I give console.log to the variable overlays , I have the following return: [Oh, 36: Oh, 37: Oh, 97: Oh, 98: Oh, 99: Oh, 100: Oh, 101: Oh] 0: Oh 36: Oh 37: Oh 97: Oh 98: Oh 99: Oh 100: Oh 101: Oh length: 102 __proto__: Array[0...
asked by 11.02.2015 / 14:41
2
answers

How to count how many times an item is repeated in an Array of unknown size?

How do I count how many times an item appears in an Array that I do not know the size of? The array was created from a .CSV.     
asked by 11.11.2014 / 00:45
2
answers

Delete element from an array

I need to delete the first element of an array. I have: Numero[10] . How do I exclude the value in Numero[0] and overwrite the other elements?     
asked by 18.03.2017 / 18:54
3
answers

Change value of an array when null

I have a WebService in PHP that returns me a JSON with values from a mySQL database. I need an Array, whenever there is a null value (when = null ), is changed to white ( = "" ). I'm doing it this way, but without success. &l...
asked by 04.11.2014 / 10:44
3
answers

How to transform an Array of Objects into a Simple Array? Javascript

I would like to know how I can transform an Object Array into a Simple Array only with a certain value. I have this: const names = [ {id:0, name:"Jean"}, {id:2, name:"Ricardo"}, {id:4, name:"Letiiicia"}, {id:5, name:"Dai"}, {i...
asked by 03.03.2018 / 16:55
3
answers

Strange value when printing array

In java , I'm having difficulty understanding some concepts. On a .jsp page, I have the following code:    String [] arrayRegioes =   request.getParameterValues ("numRegiaoUsuario"); // object When I print the array, the value...
asked by 24.03.2016 / 13:51
2
answers

Why can I pass a vector of char to the scanf as an address or a direct variable?

If the vector name or array is already the address of the first element, why in scanf() , using the primitive types ( int , char , float , double ) I need to pass the address, and when we want to read a string (...
asked by 02.11.2017 / 15:46
2
answers

How to merge two multidimensional arrays, neglecting repeated values?

I have two multidimensional arrays . An array I am bringing from a .json file , the other is coming from a POST via Ajax . My idea is to generate a new array by merging these two other multidimensional arrays without repeating the data....
asked by 12.09.2017 / 06:31