QA


Q&A

Q

Must a control structure's test expression result in a Boolean value?

A

Ultimately, yes, but in the context of a test expression, zero, an undefined variable, or an empty string will be converted to false. All other values will evaluate to TRue.

Q

Must I always surround a code block in a control statement with brackets?

A

If the code you want executed as part of a control structure consists of only a single line, you can omit the brackets. However, the habit of always using opening and closing brackets, regardless of structure length, is a good one.




Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net