function variable_get

Returns a persistent variable.

Case-sensitivity of the variable_* functions depends on the database collation used. To avoid problems, always use lower case for persistent variable names.

Parameters

$name: The name of the variable to return.

$default: The default value to use if this variable has never been set.

Return value

The value of the variable. Unserialization is taken care of as necessary.

See also

variable_del()

variable_set()

680 calls to variable_get()
ActionLoopTestCase::triggerActions in modules/simpletest/tests/actions.test
Create an infinite loop by causing a watchdog message to be set, which causes the actions to be triggered again, up to actions_max_stack times.
actions_do in includes/actions.inc
Performs a given list of actions by executing their callback functions.
aggregator_admin_form in modules/aggregator/aggregator.admin.inc
Form constructor for the aggregator system settings.
aggregator_categorize_items in modules/aggregator/aggregator.pages.inc
Form constructor to build the page list form.
aggregator_expire in modules/aggregator/aggregator.processor.inc
Expires items from a feed depending on expiration settings.

... See full list

1 string reference to 'variable_get'
system_test_menu in modules/simpletest/tests/system_test.module
Implements hook_menu().

File

includes/bootstrap.inc, line 1288

Code

function variable_get($name, $default = NULL) {
    global $conf;
    return isset($conf[$name]) ? $conf[$name] : $default;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.