You are here: Re: Anoying problem with multiple 'elseif' variations... « PHP Language « IT news, forums, messages
Re: Anoying problem with multiple 'elseif' variations...

Posted by Andrew Bullock on 10/26/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

 

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

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