G.4. Naming

The names of variables, constants, and functions should begin with a lowercase letter. In names that consist of more than one word, the words are written together and each word starts with an uppercase letter. Use short names for variables used in a small scope, such as just inside a for loop. Use longer names for variables used in larger scopes. Function names should begin with a lowercase letter and use capitals for subsequent words.

 /* ** Function getAddressFromEnvironment ** Input: $Prefix - prefix used to generate address form ** Return: array suitable for addressFields */ function getAddressFromEnvironment($Prefix) { global $AddressInfo; //get list of all address fields //from the AddressInfo array reset($AddressInfo); while(list($field, ...

Get Core PHP Programming, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.