尝试variable_set()和variable_get()
像这样设置变量:
// I have assumed the variable name to be "the_name_of_the_variable"
variable_set("the_name_of_the_variable", "the value of the variable");
Run Code Online (Sandbox Code Playgroud)
然后像这样检索值:
$my_variable = variable_get("the_name_of_the_variable", "a default value in case the variable has never been set before");
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助...穆罕默德。