function variable_get

7.x variable_get($name, $default = NULL)

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.


$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



617 calls to variable_get()
ActionLoopTestCase::triggerActions in drupal/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 drupal/includes/
Performs a given list of actions by executing their callback functions.
AggregatorCronTestCase::testCron in drupal/modules/aggregator/aggregator.test
Adds feeds and updates them via cron process.
AggregatorTestCase::getDefaultFeedItemCount in drupal/modules/aggregator/aggregator.test
Returns the count of the randomly created feed array.
aggregator_admin_form in drupal/modules/aggregator/
Form constructor for the aggregator system settings.

... See full list

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


drupal/includes/, line 946
Functions that need to be loaded on every Drupal request.


function variable_get($name, $default = NULL) {
  global $conf;

  return isset($conf[$name]) ? $conf[$name] : $default;