Questions tagged as 'array'

2
answers

PHP function in_array ()

I'm developing a system that takes the category IDs that are stored in the database, separated by , , I'm using explode , turning them into a array and then I'm using the array_rand() to sort only one value of this arra...
asked by 20.11.2014 / 18:06
1
answer

Codeigniter: retrieve array values out of loop

I have a problem storing the array values in the code below: public function get_submenu() { $query = $this->db->get_where('categories', array('category_id_parent' => 0)); foreach ($query->result() as $row): $cat_i...
asked by 03.07.2014 / 10:50
1
answer

How to create an array with input data with checked checkboxes?

With this script, written in short because you know better than I do. <?php $query = "select from table where status='0'"; $i=0; while (mysqli_fetch_array) echo '<input type="hidden" value="' . $num_compra . '" name="item['.$i.'][num_...
asked by 03.10.2014 / 04:04
1
answer

Struct Vector: Pass by reference in C

This code is a simple register of people, containing code and the person's name. I am confused as to passing the struct vector to the "insert" procedure. When compiling, the program stops working. In the compiler I get the following error: "P...
asked by 30.10.2018 / 19:38
1
answer

How to access methods of an array of objects?

I'm doing a college job in which I have to develop a banking system, so I have 3 account types (1 class for each type), so I want to use an array of generic objects. The problem is to access the methods of the objects contained in the array, in...
asked by 28.10.2018 / 00:11
1
answer

How to clear / remove ALL elements of the array in javascript?

I'm creating a calculator in javascript for better learning and I'm having difficulty with remover todos os elementos do array . Do you know when you click on the " AC " button on the calculator and it removes everything? That's wh...
asked by 25.11.2018 / 23:06
2
answers

Doubt about filling Array in Java

I'm having trouble solving the following exercise:    Create a class with a main method;    Create a 10-position int array and popule using for    Print all the values in the array and, for even values, display the value followed by the wo...
asked by 09.08.2018 / 16:03
1
answer

Array only loads last record in PHP with PDO

I'm generating the information, but only fills the last line of the query executed inside the Array, even though I'm sure it's running all the rows in the foreach. Any ideas how to populate all the arrays with all the information? <?php hea...
asked by 11.08.2018 / 21:36
1
answer

Get each line of a CSV file

I need to get data from a CSV file and store it in an array. Example: CAIO ; 0909;abacaxi BRUNO;1231;maça I have to take for example line 1, and each value of each column store in a variable to play in a theft function (Selenium). The...
asked by 08.08.2018 / 20:26