Announcement

Collapse
No announcement yet.

true and false

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • true and false

    I'm learning C++ in school and trying to teach myself PHP on the side but does true and false work in PHP or will I have to switch to using 0 or 1?
    Surrix.net: Computer help forums/articles

    The person in my avatar is Elisha Cuthbert she plays on Fox's 24

  • #2
    true or 1 will both mean true, false or 0 both mean false.

    PHP Code:
    if(true)
    { echo 
    "this is true"; }
    if(
    1)
    { echo 
    "this is true"; }
    if(
    false)
    { echo 
    "this is false"; }
    if(
    0)
    { echo 
    "this is false"; } 
    I just realised if you were to actually try the code above, that the trues would only appear, silly me

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X