Questions tagged as 'foreach'

1
answer

radio button selected according to BD in the foreach

Good morning, how can I make the radiobutton selected according to the database, I have a table in the bank with the categories being listed in a foreach on the radiobutton, until the beauty, it works to insert, but at the time of edit I need a...
asked by 05.11.2018 / 12:15
1
answer

How to put a layout for the search results of an input search that are within the echo?

I need to put a layout in the search results of the input search, I have a page that uses the layout of Cards of bootstrap 4, and I wanted the search results to look the same. This is the script I use in the layout of my other page: <div cl...
asked by 11.09.2018 / 23:31
1
answer

How to print on screen or console, an array of strings in php

I've been seeing the documentation but it's not clear how I do it. I have an array of strings: $remetente = $con->real_escape_string($_REQUEST['rem']); $arrai= array(); $remetenteArray[] = str_split($remetente, 1); As you can see, $re...
asked by 27.05.2018 / 14:53
1
answer

How to use ForEach in a multidimensional array in PHP

I would like to know how to run the entire array with ForEach only: $Marcas = array(array('Fiat', 'Volkswagen', 'Audi'),array('Yamaha', 'Suzuki', 'Honda'),array('Samsung', 'Motorola', 'Apple'));     
asked by 07.06.2018 / 23:13
1
answer

How to "join" foreach results

I have a script to do multiple upload files in php. At the time of uploading, he wanted him to insert into the photos table the information with the names in that format: "name1.jpg | name2.jpg". The query I use to insert is this: INSERT IN...
asked by 15.06.2018 / 21:54
1
answer

(JAVA) Error in foreach

Why does an error occur in executing the code below if I remove the break? The value of the ArrayList client is not updated every time it completes the? for (Cliente cliente : clientes) { if (identificacao==cliente....
asked by 15.04.2018 / 19:36
1
answer

How to get first value returned by foreach

I am new to programming and am trying to solve my problem with foreach ... I have a foreach that returns me the groups of photos that have photos in them ... however I need to get the first group that the foreach find photos and apply the che...
asked by 08.03.2018 / 15:09
3
answers

Sum of an array and concatenation of PHP value

I have a dynamic array, it contains keys that duplicate (TAG): [0] => Array ( [0] => Array ( [tag] => 5x1 Acessori Kids [pedido] => 6701622409...
asked by 12.02.2018 / 20:53
1
answer

Foreach inside another array in php [duplicate]

How can I generate with php this array to make a payment transaction for the Pagseguro? $params = array( 'email' => $PAGSEGURO_EMAIL, 'token' => $PAGSEGURO_TOKEN, 'credi...
asked by 04.09.2017 / 18:54
2
answers

Return 2 values in a foreach

I would like to return two values in a foreach , can you help me? For Each item In Funcao() teste1 = gostaria de pegar aqui o resultado 1 teste2 = gostaria de pegar aqui o resultado 2 Next Private Function Funcao...
asked by 04.09.2017 / 21:35