You are here: Re: WHAT ARE THOSE DARN BRACES DOING IN THERE? « PHP Programming Language « IT news, forums, messages
Re: WHAT ARE THOSE DARN BRACES DOING IN THERE?

Posted by Schraalhans Keukenmeester on 05/17/07 19:29

At Thu, 17 May 2007 12:17:40 -0700, cybervigilante let his monkeys type:

> My PHP is rusty, but I'm trying to follow Joomla code and I keep
> seeing reverse braces inside php blocks that look to me like they'll
> break the interpreter. The code works. What am I missing here? Is this
> something new to php5 or some preproccessor or something?
>
> Stuff like this:
>
> <?php } else { ?>
>
> or this. where you see that left brace right before the ? I haven't
> done php in a while. Am I forgetting something obvious?
>
> <?php if(mosCountModules('right')) {
> ?>
> <div id="mcontent">

See it like this:
if the condition is true:
{ // block opening brace
?> step out of PHP
<div blabla etc. // output html code
<?PHP // step back into php
} // end the code block
else // condition not met
{ // begin other code block

etc etc.

HTH
Sh.

 

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

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