Re: [PHP] skip a row in foreach loop

2005-08-03 Thread Jochem Maas
[EMAIL PROTECTED] wrote: Yes, it comes fro DB, but, quesry is alerady "to complex" (for me :)) with union, joint, ... and expanding with something else ill take ^ \__ I think to many of these are the problem ;-) additional few hours to figure it out. ... --

Re: [PHP] skip a row in foreach loop

2005-08-03 Thread [EMAIL PROTECTED]
Yes, it comes fro DB, but, quesry is alerady "to complex" (for me :)) with union, joint, ... and expanding with something else ill take additional few hours to figure it out. And, Stut's and Chris' "continue" solution sound perfect for me :) Thanks guys on such a fast respond! -afan John

Re: [PHP] skip a row in foreach loop

2005-08-03 Thread Stut
[EMAIL PROTECTED] wrote: I have a code foreach($results as $key => $value) { echo $key.': '. $value .''; } But, $value could be zero too. How to skip printing on screen when $vlaue == 0? foreach($results as $key => $value) { if ($value == 0) continue; echo $key.': '. $value .''; } -

Re: [PHP] skip a row in foreach loop

2005-08-03 Thread Chris Boget
but there is a tons of code lines inside the loop and was thingking is there any part in foreach function that can do that? something like: foraech($results as $key => $value, skip(empty($value))) { // } 'continue' is your friend. http://us3.php.net/manual/en/control-structures.continue.php

Re: [PHP] skip a row in foreach loop

2005-08-03 Thread John Nichel
[EMAIL PROTECTED] wrote: I have a code foreach($results as $key => $value) { echo $key.': '. $value .''; } But, $value could be zero too. How to skip printing on screen when $vlaue == 0? I know I can do foreach($results as $key => $value) { if(!empty($value)) { echo $key.': '.

[PHP] skip a row in foreach loop

2005-08-03 Thread [EMAIL PROTECTED]
I have a code foreach($results as $key => $value) { echo $key.': '. $value .''; } But, $value could be zero too. How to skip printing on screen when $vlaue == 0? I know I can do foreach($results as $key => $value) { if(!empty($value)) { echo $key.': '. $value .''; } } but th