Questions tagged as 'array'

1
answer

How do I get the PDO to list the Array with the Correct Types?

In MySQL I write data in a table defining some fields as int or float , but when I make a select in the database via PDO the array comes all as a string. Is there a function that forces the type to be returned as it is...
asked by 19.09.2016 / 22:45
1
answer

Number of repetitions within an array

I'm trying to count how many times an element appears inside an array. ' public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] array = new int[4]; int a; for(int i = 0; i < arr...
asked by 25.08.2016 / 03:31
1
answer

I would like to verify in the customer registry if the code you entered already exists. How do I do?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AtFinal { class Program { struct Cliente { public int cod_cli; public...
asked by 25.08.2016 / 05:41
1
answer

Compare two arrays with PHP

I'm developing a project where I need to compare two arrays and organize the values. Example: # Objeto 1 $array1 = [1, 2, 3]; # bjeto 2 $array2 = [2, 1, 3]; I need to show the user a list of this type: Comparison: Obj 1 | Obj 2 1...
asked by 23.08.2016 / 13:11
2
answers

Memory error generating spreadsheet with PHPExcel

I'm having problems generating Excel spreadsheets using PHPExcel when the number of records is too large, the memory is insufficient to process the job, is there any way to improve the creation of this file through some caching system?     
asked by 19.10.2016 / 21:52
1
answer

Error assigning object to another class

In the code it moves the values of the employees with the first value entered and ignores the others. for(int i=0; i<3; i++) { Empregados f = new Empregados(); System.out.println("Qual é o salario do " + (i+1) + " e...
asked by 05.07.2016 / 01:25
1
answer

PHP convert a commercial sentence (&) to array

It has a native PHP function that converts a QueryString into Array Example: page=index&produto=115&usuario=2 Array( [0] => 'page=index', [1] => 'produto=115', [2] => 'usuario=2' ) I know I can use explode('&am...
asked by 13.06.2016 / 10:31
1
answer

str_replace only replaces the second array

Hello, I have a problem that I have tried to repair in several ways, but I can not! I've already looked into the str_replace() function in php.net and nothing! I have the following code: $cod = '192.168.1.1'; $char = '300'; $ar...
asked by 07.07.2016 / 23:37
2
answers

Converted a two-dimensional array to an object in PHP. How to access the values?

Hello, I have the following array: $array[0]["nome"] = "nome exemplo"; $array[0]["idade"] = "idade exemplo"; $array[1]["nome"] = "nome exemplo 2"; $array[0]["idade"] = "idade exemplo 2"; I created an object of this array: $obj = (object)...
asked by 20.04.2016 / 19:45
1
answer

How to print the prefixes along with the array?

I would like help with printing an array with its prefixes. this.prefixo = [ { "E01":[{"name":"Teste01"}], "E02":[{"name":"Teste02"}] } ]; I would like to print the prefixes and names related to e...
asked by 13.04.2016 / 20:53