Questions tagged as 'array'

2
answers

Save values in the variable

Save values in a variable coming from GET Example: $id = $_GET['id']; $dados = array($id); Doubt: How do I save all IDs? Well, I'll use those IDs to identify which product was selected. I created a shopping cart using SESSIO...
asked by 04.03.2014 / 22:09
3
answers

Retrieve the index of an object with a certain attribute inside an array of objects

I have the following in javascript: var listaImagens = [{"idImagem":4,"arquivo":"illustration_transport-04.svg","idCategoria":1,"nomeCategoria":"Transportes","modificacoes":[{"id":"sxqae3wtj1h2rzfr","cor":"#ff6500"},{"id":"egltjnqi7ut2zkt9","c...
asked by 11.09.2014 / 15:49
1
answer

How to get a data from an array of arrays. react-native

Good morning, could anyone help me with react-native ??? The codes below and my doubts are below componentDidMount() { return fetch('http://portal.ema.net.br/api/getprocedimentospublicos', { method: 'POST', }) .then(response => response.jso...
asked by 21.12.2018 / 14:52
1
answer

Illegal string offset in php [closed]

I'm trying to run the code below, but it's returning the error:   Warning: Illegal string offset 'name' tasks.php on line 89 <?php session_start(); if (isset($_GET['nome']) && $_GET['nome'] != '') { $...
asked by 09.05.2014 / 02:44
1
answer

How to add values inside an array?

I have an integer value and need to transform into an array to do the sum of each of the elements individually. I did this (example): int n = 1230; string sn = Convert.ToString(n); //converte em string char[] narr = sn.ToArray(); //converte em...
asked by 26.11.2018 / 04:12
2
answers

Assign multiple array to a variable dynamically

Hello, I need to assign multiple array to a single variable, the value of all of them will be in sequence in that variable. Ex.: $variavel = $array[0] . $array[1] . $array[2] . $array[3] . $array[4]; echo $variavel This variable then uses i...
asked by 14.11.2018 / 14:35
1
answer

Change the first and last element of an array by creating a new array

Why does the value of Numbers[0] change to 3 after executing the line of code below? New_Numbers [0] = Numbers [Numbers.length - 1]; The complete code: public static void main(String[] args) { System.out.print("Indique o número...
asked by 11.11.2018 / 18:24
1
answer

Treat a POST array from a table

Good evening, my dear ones. I'm having a hard time dealing with some data. I created a table, where <td> are fed dynamically when passing through a foreach like this: <table class="table table-striped table-bordered" id="tb-...
asked by 03.11.2018 / 00:29
1
answer

Generate array with substrings positions

Is there any way I can get a string, for example: "John was bar last night". Generate an array that stores the position of all "" strings of this string. I'll use this to put these positions, for example, "no", "de". Having thus: "John went t...
asked by 21.11.2018 / 20:16
1
answer

Printing items from an associative array in random order [closed]

I am creating a merry-go-round, where you will have 3 sliders containing 15 images within each one, totaling 45 images. I'vecreatedanassociativearraytodisplaytheseimagesrandomly,sofarsogood,however,nowIneedthefirst15itemstobefixed,whereIca...
asked by 22.11.2018 / 19:37