| 5 bootstrap.inc | variable_set($name, $value) |
| 6 bootstrap.inc | variable_set($name, $value) |
| 7 bootstrap.inc | variable_set($name, $value) |
| 8 bootstrap.inc | variable_set($name, $value) |
Sets 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 set.
$value: The value to set. This can be any PHP data type; these functions take care of serialization as necessary.
See also
328 calls to variable_set()
File
- core/
includes/ bootstrap.inc, line 894 - Functions that need to be loaded on every Drupal request.
Code
function variable_set($name, $value) {
global $conf;
db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
cache('bootstrap')->delete('variables');
$conf[$name] = $value;
}
Login or register to post comments