Skip to content

Latest commit

 

History

History
executable file
·
15 lines (12 loc) · 366 Bytes

variable-naming.md

File metadata and controls

executable file
·
15 lines (12 loc) · 366 Bytes

PHP Naming Convention > Variable Naming

camelCase

  • Begin with a lowercase e.g. id, name.
  • If multiple words: start it with the lowercase letter followed by an uppercase letter e.g. emailAddress, firstName
  • Avoid using underscore or dash
  • Avoid one-character variables e.g. a, b
  • Cannot start with a number
<?php
$emailAddress = 'John Doe';
?>