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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.