Posted by Stut on 08/03/05 18:57
afan@afan.net wrote:
> I have a code
>
> foreach($results as $key => $value)
> {
> echo $key.': '. $value .'<br>';
> }
>
> 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 .'<br>';
}
-Stut
Navigation:
[Reply to this message]
|