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

Posted by Steve on 10/14/38 11:34

> 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

 

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

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