Constants should always be uppercase, with underscores to separate words. Prefix constant names with the name of the class/package they are used in. For example, the constants used by the DB:: package all begin with “DB_”.
True and false are built in to the php language and behave like constants, but should be written in lowercase to distinguish them from user-defined constants.
Function names should suggest an action or verb: updateAddress
, makeStateSelector
Variable names should suggest a property or noun: UserName
, Width
Use pronounceable names. Common abbreviations are acceptable as long as they are used the same way throughout the project.
Be consistent, use parallelism. If you are abbreviating “number” as “num”, always use that abbreviation. Don't switch to using “no” or “nmbr”.
Use descriptive names for variables used globally, use short names for variables used locally.
$AddressInfo = array(...); for($i=0; $i < count($list); $i++)