Section 5.2. True or False


5.2. True or False

PHP considers some values to be equivalent to true, and others equivalent to false. Most numbers are true (e.g., 1, 59, 1,203,391,462), but 0, 0.0, 0.00000 are all false.

Nearly any string with a value in it is considered to be true, so "a," "193" (an integer inside a string), and "This is a test" are all true. However, an empty string ""and "0" are both false. Confusingly, though, "0.0" is true, as is "0.0000."



PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

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