Questions tagged as 'foreach'

2
answers

Does the ListT.ForEach Method exist?

I'm trying to implement the example of this page , but VS2015 (.NET 4.5) says that the ForEach() method does not exist class Program { static void Main() { List<String> names = new List<String>(); na...
asked by 15.11.2015 / 02:57
1
answer

Foreach within Foreach PHP

I have the following code: $row = $twitterusers->selectUserAll(); foreach ($row as $fetch) { $users[] = $fetch; } var_dump($users); It takes all the users of the table, however when using var_dump I realize that it has ar...
asked by 25.07.2017 / 14:45
1
answer

Conditional Resolve

I have a if that is not being satisfied ever. I think I'm using some loop in the wrong way. I've checked the value of all variables, and they're all correct. So I'm going to pass variable values here and you, if you can, analyze w...
asked by 04.05.2014 / 05:06
0
answers

Get information from an array inside a foreach - PHP

Good afternoon. I'm developing an application with PHP using Laravel, and I'm having a hard time. I have a table with the name of Account, in which it has the code of this account, represented by the variable $ client-> Code, also has the...
asked by 28.10.2017 / 17:55
1
answer

Method with foreach only returns false

I have a method that will check if the debt equals zero ( divida == "0" ). If it returns true , otherwise it returns false . Code: for(String divida : dividas){ return divida == "0"; System.out.println(...
asked by 26.07.2015 / 20:05
2
answers

How to exit a cycle in C #?

I need to exit foreach when the value is equal to 1 foreach (DataGridViewRow dr in dgvValetes) if(dr.Cells["valor"].toString()=="1") //Sair aqui I do not know how to do ...     
asked by 16.06.2016 / 12:36
3
answers

How to list the properties of an object in php using foreach?

I have the following class: class Usuario{ private $nome; private $profissao; function setNome($nome){ $this->nome = $nome; } function getNome(){ return $this->nome; } function setP...
asked by 02.08.2016 / 16:26
2
answers

Change foreach by for

I need to change the following foreach() to for() . The problem is that instead of arrays the loop runs through a dictionary. This is the code I want to transform a for() : foreach (var joint in body.Joints.Values) //transf...
asked by 16.06.2015 / 17:20
3
answers

Error listing items in an array with foreach ()

I have array with the list of several Brazilian banks and I need to get the name of the bank where the code of it is passed according to what it has in the user's account, but when doing this search for the code it r...
asked by 28.12.2015 / 18:52
1
answer

Help with PHP Replication Structure - PARSER - simple_html_dom.php

I am making a parser with simple_html_dom.php where I pull all the links of a certain page. I can pull the links and assign to an array, then the problem comes up: This page has a maximum display limit of 36 items per page. items i...
asked by 19.05.2015 / 15:39