You are here: if...else - in which order « PHP Programming Language « IT news, forums, messages
if...else - in which order

Posted by Sonnich on 11/01/06 11:36

this is probably an old topic:

if(a==1)
if(b==2)
echo "a is 1 and b is 2";
else
// what happens here?
echo "a is 1 and b is not 2";

The question is, where the else will react too. Usually it should be
the last if.

In general I put {} around just to be sure.

BR
Sonnich

 

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

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