1. Home
  2. Docs
  3. PHP Style Guide
  4. Variable Names

Variable Names

The guidelines for variable naming are very similar to those used for class methods. Variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

INCORRECT:

CORRECT:

Was this article helpful to you? Yes No

How can we help?