Questions tagged as 'foreach'

1
answer

Foreach in fields

Good afternoon. I am having trouble displaying the data in a form, where it can have multiple addresses and within these addresses can have several involved. I tried something like: foreach($input[endereco] as $key => $endereco){ foreac...
asked by 03.04.2018 / 21:09
1
answer

Java / JSTL - Table listing with c: forEach

I've tried listing database information on a JSP page using the <c:forEach> tag, but I'm not getting any return values. ADO: @Override public List<Livro> consultar() throws SQLException{ List<Livro&g...
asked by 21.02.2018 / 19:21
0
answers

About array foreach while loop for ... to leave results in alphabetical order

<? $n = 0; $limite = 10; while ($n <= $limite-1){ $dates = array($user["members"][$n]["rank"]); foreach ($dates as $value){ echo $value; } $n++; } ?> It returns the following value: 87 41 34 32 88 26 16 26 48 0 But I would like...
asked by 18.02.2018 / 04:57
0
answers

Foreach in PHP with SimpleXMLElement Object

I need access to the information (media_id, media_type, etc.) within the object array below. How should I proceed? [midias] => SimpleXMLElement Object ( [midia] =&...
asked by 15.02.2018 / 12:25
0
answers

Generate automatic api sequence when clicking the specific product

I have a customer portal, and in this customer portal will have a "my purchases" page there will show the products purchased, and when you click on it will appear the "tracking" of this product with various information. I do this with data from...
asked by 03.01.2018 / 15:22
0
answers

Array in a PHP mosaic

I have a mosaic mounted in html and css, what I need is to mount an array bringing the last posts of the database, and list in it, going through all the divs in sequence, I always programmed an array for a DIV only, I'm using PHP instead of PHP....
asked by 29.11.2017 / 14:02
0
answers

Error with array passing in foreach

function preencherJason() { document.getElementById('json_prod').value = ''; var arrayProduto = []; var table = $('#products_table'); table.find('tr').each(function() { var nodesTd = $(this).children(); var array =...
asked by 01.12.2017 / 05:41
0
answers

JSON reading (Trying to get property of non-object error)

I have the following JSON in $ return: { "xml": "{ \"orders\":[ { \"code\":\"PedidoTeste-1508156986545\", \"channel\":\"PedidoTeste\", \"placed_at\":\"2017-10-16T10:29:46-02:00\", \"updated_at\":\"20...
asked by 17.10.2017 / 15:54
1
answer

How to page a foreach from a file_get_contents?

I am querying an API that gives me data formatted in JSON, I collect through file_get_contents and then print all values using a foreach. But there are many values, more than 5,000 items, I need to page them, I tried to limit them using an array...
asked by 03.09.2017 / 02:47
1
answer

How do I show some elements of an array following this criterion?

I have to make a php form that in the end shows the price of each product bought, showing only the prices of the products that were marked in the other column of the table in the checkbox: FORM: **<!DOCTYPE html> <html> <head...
asked by 06.08.2017 / 01:46