i have used variable_set to save one value.How can i save multiple values through array using variable_set. Please provide the solution
Take the 2-minute tour
×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.
I think best way to save array value in varible_set(); is json. drupal_json_encode() and drupal_json_decode() function in drupal 7. You can do something like this:-
Hope this help! |
|||||
|
It's the same way: The variable_set function saves the variable to database serializing it. Variable_get takes the variable from $conf where the variable is already unserialized. Example:
Output
|
|||||||||||||
|