You are here: Re: PHP Foreach HELP! « PHP Programming Language « IT news, forums, messages
Re: PHP Foreach HELP!

Posted by matt on 10/22/04 11:34

Steve wrote:
>>The Continue Method is causing me problems, After the first instance
>>where $g != $gallery, it goes to the end of the code and closes the
>>table... then it goes back and prints the second photo, causing the
>>second image to not be inside the table that is opened at the start of
>>the code
>
>
> Firstly, you make the other correction suggested, moving the close
> table tag outside the loop? And secondly, use Erwin's logic which does
> not require an explict "continue":
>
> foreach ($data as $line)
> {
> // ...
> if( $g == $gallery )
> {
> // ...do the table output here...
> }
> }
> // this should be outside the foreach() loop:
> echo '</table>';
>
> ---
> Steve
>
Worked a treat. Thanks for your help!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация