QA

Q&A

Q1:

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

A1:

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.

Q2:

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

A2:

If the code you want executed as part of a control structure consists of only a single line, you can omit the brackets.



Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

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