Questions tagged as 'array'

1
answer

Receive array values

How do I get the values for this checkbox? <input type="checkbox" name="Item[<?php echo $IDCatalogo; ?>][<?php echo $IDItem; ?>]"> foreach( $_POST['Item'] as $key => $n ) { print "<p>".$n." | ".$key....
asked by 19.09.2015 / 20:39
2
answers

Reverse order of names in inputs?

I'm trying to do an exercise where I have to get 5 names in 5 different input, store them in an array and print them in the same fields but in the reverse order they were. function inverteNomes(){ var nome1 = document.getElementById("txtN...
asked by 01.09.2015 / 03:36
1
answer

Alternative to database in PHP?

I want to know if there's a way to save form data, display it, and edit it without using a database? Because whenever a software will do integration with database I stop because I do not understand database very well yet. I was thinking of doing...
asked by 23.08.2015 / 06:43
1
answer

Generic vector with error

I'm completing this generic vector activity, however I'm having trouble returning the last and the first element of the list. and to remove the element. public class Vetor<T>{ T[] vetor; int qntElementos = 0; public Vetor(i...
asked by 06.05.2016 / 19:16
1
answer

At what points does ArrayAccess not resemble the native PHP array?

I know that ArrayAccess exposes an interface to access some elements of the object as if it were a array Example: class ListObject implements ArrayAccess{ protected $storage; public function offsetSet($key, $value) {...
asked by 09.07.2015 / 18:19
1
answer

What is the reason why a vector with no set size does not work?

Here's if you create a vector: Thus int Vetor[0]; works #include <iostream> using namespace std; int main() { int vetor [1]; vetor[0] = 12; cout << vetor[0] << endl; } Thus int Vetor[]; does...
asked by 02.08.2017 / 23:14
1
answer

How to return array indexes in method

Well I could not find a better title for my case, I have the following function : public function select_tokens() { $sql = "SELECT * FROM 'users'"; $select_tokens = Database::DB()->prepare($sql); $select_tokens->execute();...
asked by 31.07.2017 / 12:57
2
answers

Error removing item from ArrayList

I'm "joking" with the canvas (android) and I'm having trouble removing element from an ArrayList. The app works like this: The user clicks on the screen, a ball appears that goes up but I want to remove only the balls that have exceeded the l...
asked by 09.09.2015 / 22:17
1
answer

Error passing JS array values to simple PHP

My code is the one below: <html> <body> <form method="post" action="recebe.php" > <input type="hidden" id="send_string_array" name="send_string_array" value="" /> <input type="submit" value="Enviar" /> </for...
asked by 12.06.2015 / 04:06
2
answers

How to insert an array into a variable?

Realizing that it has a lot of repetitive code I decided to automate it by creating a looping of reading the cells of my excel file. #row cell fixa para o horario rows = ts[1].rows cells = rows[1].cells #Segunda 7h40min - 8h30min cell = cells[...
asked by 01.04.2015 / 01:50