Scope can be defined as the range of availability a variable has to the program in which it is declared. PHP variables can be one of four scope types:
- Local variables
- Function parameters
- Global variables
- Static variables.
Global Variables:
In contrast to local variables, a global variable can be accessed in
any part of the program. However, in order to be modified, a global
variable must be explicitly declared to be global in the function in
which it is to be modified. This is accomplished, conveniently enough,
by placing the keyword GLOBAL in front of the variable that should be
recognized as global. Placing this keyword in front of an already
existing variable tells PHP to use the variable having that name.
| Name |
Description |
|---|---|
| $base_path | The base path of the Drupal installation. |
| $base_root | The root URL of the host, excluding the path. |
| $base_theme_info | An array of objects that represent the base theme. |
| $base_url | The base URL of the Drupal installation. |
| $channel | An associative array containing title, link, description and other keys. |
| $conf | Array of persistent variables stored in 'variable' table. |
| $cookie_domain | The domain to be used for session cookies. |
| $databases | Array of database connections. |
| $element | Structured array describing the data to be rendered. |
| $forum_topic_list_header | An array of forum topic header information. |
| $image | Current image tag used by aggregator parsing. |
| $installed_profile | The name of the profile that has just been installed. |
| $is_https | Boolean indicating whether or not the current request is secured by HTTPS. |
| $item | General string or array. |
| $items | Array of items used by aggregator. |
| $language | An object containing the information for the active interface language. |
| $language_content | An object containing the information for the active content language. |
| $language_url | An object containing the information for the active URL language. |
| $menu_admin | Boolean indicating that a menu administrator is running a menu access check. |
| $multibyte | The current multibyte mode. |
| $pager_limits | Array of the number of items per page for each pager. |
| $pager_page_array | Array of current page numbers for each pager. |
| $pager_total | Array of the total number of pages for each pager. |
| $pager_total_items | Array of the total number of items for each pager. |
| $tag | Active tag name. |
| $theme | Name of the active theme. |
| $theme_engine | The theme engine related to the active theme. |
| $theme_info | Active theme object. |
| $theme_key | Name of the active theme. |
| $theme_path | The path to the active theme. |
| $timers | Timers that have been created by timer_start(). |
| $update_free_access | Allows the update.php script to be run when not logged in as administrator. |
| $user | An object representing the user currently visiting the site. |
No comments:
Post a Comment