Questions tagged as 'foreach'

1
answer

foreach javascript array

I have the following script: var data = JSON.parse( '<?php echo json_encode($lista_tipo_indicadores) ?>' ); var cores = JSON.parse('<?php echo json_encode($cores) ?>'); // Quantidade de Indicadores por Tipo var doughnutData =...
asked by 29.01.2016 / 13:59
4
answers

Increment a counter inside a foreach in php

In a foreach loop, I need to increment a counter to set the tabindex of the form fields so that the result is: <input type="text" name="endereco[0][cep]" value="00000-000" tabindex="1"> <input type="text" name="endereco[0][rua]" va...
asked by 03.11.2017 / 20:50
1
answer

How to encrypt multiple variables inside a file with php?

I'm using php to read a file for a $string , it has some variable words that I need to find and replace with others, ie I need to get these variables, encrypt them with AES and write back where they were, making a replace . The...
asked by 19.10.2016 / 06:16
1
answer

Warning: Illegal string offset

I am trying to show in the report the result of a INNER JOIN of 3 tables, I save the 3 values in a array and I make a foreach to go through all the records, but the following error appears:    Warning: Illegal string offse...
asked by 11.05.2017 / 20:29
2
answers

Foreach with PHP StdClass

My page shows posts that have been registered to the database. Some posts have files that have been uploaded. These files are saved in server folders and the database has the table "Pivot_files" with columns ID, Post, Name and Size. $postagens...
asked by 23.11.2016 / 08:34
1
answer

How to traverse attributes of a JSON?

I'm trying to traverse attributes of a json, I'm trying that way for (var i = 0, length = r.length; i < length; i++) { for (var i2 = 0,length = r[i].lenght; i2 < length; i2++ ){ console.log("teste"+r[i][i2]); } } How...
asked by 27.10.2015 / 13:06
1
answer

Diff between two commits

I am doing git diff between two commits and in general it shows me the difference between files that have been modified in these commits. EX: git diff 1a1a1a 4d4d4d + Essa linha foi adicionada - Essa linha...
asked by 24.08.2018 / 18:26
3
answers

Multiple UPDATE from a dynamic field

I'm trying to get the% s of% s that comes from checkboxes selected by user (array), and through these id s, make an update to the table, with the following code: $ocs_imp = $_POST['check_imprime']; $contar = count($ocs_imp); $id = impl...
asked by 16.01.2015 / 03:21
1
answer

.each () terminate when the div is closed

I have the following problem, I have divs that have a dynamic amount of divs inside. <div class="grid-f"> <div class="col-4"></div> <div class="col-4"></div> <div class="col-4"></div> <div c...
asked by 04.02.2016 / 14:16
1
answer

Make a Foreach in XML with ids and store in a variable to insert data into a given table

Good afternoon, Next, I have a system that already has the ids registered in a table, (of cars, are optional of cars) and in the other table where is registered the cars calls these IDS already registered, the system only le in the bank of da...
asked by 07.11.2016 / 18:06