variable_set($name, $value)
drupal/includes/bootstrap.inc, line 618
Set a persistent variable.
$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.
function variable_set($name, $value) {
global $conf;
db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
cache_clear_all('variables', 'cache');
$conf[$name] = $value;
}