Questions tagged as 'foreach'

2
answers

Loop between an existing loop SimpleXML Photo Tag

How do I convert this (which only brings me the first photo) //corrige foto $enderecofoto = $xml->imovel[$i]->fotos->foto; $nomeeextensao = preg_replace("(^.*\/(.*)\$)", "$1$2",$enderecofoto); $removenomeeextensao = str_replace($nomee...
asked by 25.08.2015 / 21:50
2
answers

Go through components of form C #

Hello, I have a table coming from the database, with several rows and columns. One of these columns is stored the address of the previously saved image. Now I need to go through all the PictureBox and put in the ImageLocation the address of thos...
asked by 28.03.2015 / 18:58
1
answer

PHP break list items "li" into variables to add to table MYSQL

I have a form with <textarea> with the following value: <textarea id="lista-ingredientes" name="lista-ingredientes"> <ul> <li>sal</li> <li>pimenta</li> </ul> <textarea> I ne...
asked by 11.10.2017 / 14:49
2
answers

Why use three parameters for this callback function?

I'm learning JavaScript, and I was recreating the function type forEach (using a for loop) within prototype of an array . And for that I used a callback function, below: Array.prototype.forEach2 = function (callback) {...
asked by 02.09.2018 / 22:57
1
answer

Foreach repeating the same content

Scenery I have a form and via POST submitting to the page preview.php 10 song names that are divided between 4 arrays. I can generate the 10 divs containing the position array but when I create foreach for the artist I have a...
asked by 16.09.2014 / 19:08
2
answers

PHP foreach for Javascript [duplicate]

I'm in the middle of a project where I have clustering on a map. I found this algorithm found in PHP. My question is this foreach : foreach ($markers as $key => $target) { $pixels = pixelDistance($marker['lat'], $marke...
asked by 07.02.2014 / 00:58
1
answer

How to generate sequential variables (ex: d1, d2, d3) and then merge all into a single PHP variable

I have a script using foreach that generates the variables $ d, $ m, which get the value of a mysql query and put this value in the input echo " <input type='text' name='tipo' value='".$d."'> <input type='text' name='metragem' value='...
asked by 27.07.2018 / 13:41
1
answer

How to display the values of an ArrayList separately?

class Principal { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); ArrayList colecao = new ArrayList(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) {...
asked by 21.04.2014 / 01:08
1
answer

Decrease a multidimensional array

Good night, I have a dilemma, I have tried in many ways but my knowledge with array is still vague, I would like help in the following, I have two arrays, one of them I already solved with a foreach because it was a simple array like this like t...
asked by 26.04.2016 / 01:59
1
answer

I can not save all the foreach log - LARAVEL

In user id it has 2 record only that at save time it only saves 1 record and not 2, how should I do to save correctly? Follow Code below Controller Lists user data public function listardados(){ $matricula = Matricula::where('user_id...
asked by 22.11.2018 / 19:47