Questions tagged as 'array'

1
answer

Problem with multidimensional array 3x3 delete function item

Good morning colleagues, I have a problem with arrays that is breaking my head, it turns out that I have this dimensional arrangement. array(3) { [1]=> array(1) {["PC150"]=> array(7) { [0]=> string(5) "HABPC" [1]=> string(2) "PC...
asked by 02.04.2018 / 19:33
2
answers

Count the words repeated in a dictionary in Python

I would like to count all the repeated words in this dictionary and group them in another dictionary. data = [{'text': 'Real Madrid', 'type': 'ORG'}, {'text': 'España', 'type': 'LOC'}, {'text': 'Real Madrid TV', 'type': 'MISC'}, {'text': 'Espa...
asked by 11.08.2018 / 00:27
1
answer

Segmentation fault when printing an array in C ++

I'm having problems printing an array in C ++. If I do what I indicate in the code below, you can access the data of each object in the array, therefore print: void testGetVehiculos(){ string ci = "c11"; int cantVehiculos=2; int p...
asked by 25.03.2018 / 14:49
1
answer

Count () in php to get the length

It turns out that I have the following associative arrangements: Array ( [ItemID] => 192 [ItemName] => Ford [IMEI] => 0080WEWE [Status] => A ) When I use the count () method for that array the result is 4, b...
asked by 23.03.2018 / 20:47
2
answers

How can I store data from a form to an array in Javascript?

Good I would like you to help with this simple form, it is that you can capture 3 numbers from the form, that you can store them in a vector and show them with another show function. I can not make him keep the data, he just repeats it to me. Do...
asked by 10.04.2018 / 02:42
1
answer

Problem trying to order a string vector inherited from VectorString

I have a VecCadenas class that inherits from Vector<String> : public class VecCadenas extends Vector<String> I want to sort the vector (which is assembled in the constructor from a line-by-line text file), I can ver...
asked by 12.05.2018 / 14:11
2
answers

save an array of forms with checkbox

I have to save several forms at the same time and each form contains multiple checkboxes that when they are all selected, they are saved correctly but when one of them is empty, it marks an error someone helps me These are the forms you sent at...
asked by 03.03.2018 / 02:45
4
answers

Search within an Array to print match value

I have an array of users and I want to print in an html only the one with the email: "[email protected]", how can I do that search within the array. var user = [ { "id": 1, "name": "Leanne Graham", "username": "Bret", "email"...
asked by 17.03.2018 / 21:42
1
answer

Array only prints last record

I have the following structure. global.php <?php define("DB_HOST","localhost"); define("DB_NAME", "prueba"); define("DB_USERNAME", "root"); define("DB_PASSWORD", ""); define("DB_ENCODE","utf8"); ?> conexion.php <?php require...
asked by 30.01.2018 / 14:32
1
answer

PHP associative arrays

I'm trying to create an array of a mysql query and I'm going crazy. That query returns me several machines by centers. And I want to make an array with the centers that have and within each center the different machines foreach ($maquinas as $...
asked by 17.04.2018 / 09:05