Reply to Re: Anoying problem with multiple 'elseif' variations...

Your name:

Reply:


Posted by Andrew Bullock on 10/18/50 11:21

Peter Butler wrote:
> if ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a &&
> $i==a && $j==a)
> { do thing AA}


if all your different AA, BB, CC etc. "things to do" are completely
different, then they WILL all need to be coded.

However, if they are all just variations of a single bit of code - which
could be made to take the vars passed from the form as arguments, you'd
have a much shorter/better program.

All your comparisons are binary, i.e. $x is either ==a or !=a, therefor
your 14 or however many fields, can all be represented as a single
binary 'number', which you can pass as an argument

You really do need to provide some more information, like what is
actaully is you're trying to do.


Andrew

[Back to original 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

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