• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 78
  • Last Modified:

What does this mean: if (!$st['StatementRollUp'] || $st['templateid'] == '9') {

I'm looking at this and I'm thinking this is a shorthand way of coding an IF statement. But what does it mean? I was under the impression the "|" character is saying that both of the values have to equal 9, but the exclamation point is baffling me. What's the bottom line?
  • 2
3 Solutions
Ray PaseurCommented:
In plain language,...

If $st['StatementRollUp'] contains a falsy value, or $st['templateid'] contains 9, the if statement will evaluate TRUE.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
and the ! means NOT ...
brucegustPHP DeveloperAuthor Commented:
Rock on!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now