Questions tagged as 'array'

1
answer

Add values in an array with javascript to update

I need to make a user edit in PHP + javascript, however as I am a layman in javascript I do not know how to build the javascipt function since I can have different values inside the form. My form was built like this: <form action="#" v-o...
asked by 19.09.2016 / 16:04
1
answer

How to transform a JSON that contains an array of objects into a list of objects?

Good evening. I have the following JSON: { "_id": { "$oid": "3432fa43242" }, "posts": [{ "thread": { "uuid": "2911da", "url": "http://www.google.com", "site_full": "opiniaoenoticia.com.br", "site": "opiniaoenoticia.com....
asked by 26.09.2016 / 01:13
0
answers

Add array to Json output

Hello, I'm wondering how I could join this array 4 with the relationship between them. I have the page hierarchy - > post - > comments - > reply I need to associate the posts to the page, the comments to the post and the answers to the...
asked by 26.09.2016 / 22:40
1
answer

How to change the size of a global vector of structures in C?

My idea is to declare a global vector of a x-structure, but I will only have the size of the vector in main. How can I declare the vector and then tell it the size of it? I have an equivalent solution in Java, but not in C.     
asked by 20.08.2016 / 22:34
1
answer

Read a specific sentence from a file and stop at it

I want to store a part of a file in a string : Bruno Mossa Rezende 5 2 7 6 22 22 0.13 8 19 141 0.17 260 2 320 5.42 43 22 6 0.90 0 0 5 From this file I want to store in a string "Bruno Mossa Rezende", I do not want the numbers at the moment...
asked by 20.08.2016 / 03:36
0
answers

How to match a value of an array with another value in another array in Java?

I know how to get the value of an array position and compare the array values. As per the code below. for (int i = 0; i < listadosWifi.size(); i++) { /* pega o SSID e o BSSID */ providerName = "\n"+(listadosWifi.get(i).SSID)...
asked by 15.09.2016 / 14:17
0
answers

Array with PHP and PostgreSQL

Hello, I have a problem with returning information from the database. It is returning me an unordered array and with information from another bank user. Here is the Index: <?php SESSION_START(); ?> <!DOCTYPE html> <html l...
asked by 18.08.2016 / 19:16
1
answer

How do I mount pair of array key vaue to insert into table?

$key = "id,name"; $val = "'$lastid','$autor'"; ... if ($email){ $key .= ",email"; $val .= ",'$email'"; } ... $keys = \explode(',', $key); $vals = \explode(',', $val); $arr = array_combine($keys,array_fill(0,count($keys),$vals)); .... //O a...
asked by 10.09.2016 / 01:02
1
answer

PHP and MySQL image array upload

I have the following code: <?php if(isset($_FILES['files'])){ $errors = array(); foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name){ $file_name = $key.$_FILES['files']['name'][$key]; $file_size = $_FIL...
asked by 09.09.2016 / 15:05
1
answer

Sending AJAX and PHP Array

I'm trying to reorder a list of items, which when clicking a button releases the reordering and when I click again it saves, but if I do more than one reordering it only accepts the first one. Example: Item 1 = 1st Position Item 2 = 2nd...
asked by 30.08.2016 / 16:35