Если возможно, вы можете построить строку в формате JSON и использовать json_decode () следующим образом:
$json = '{
"title":"this is the new title",
"msg":"this_is_updated",
"body":"this is the new body text"
}';
$array = json_decode($json, true);
$arrayFinal = array();
$arrayFinal['customMessage'] = $array;
echo '<pre>';
print_r($arrayFinal);
echo '</pre>';
Это даст следующий результат:
Array
(
[customMessage] => Array
(
[title] => this is the new title
[msg] => this_is_updated
[body] => this is the new body text
)
)
Вы можете делать это каждый раз, но это будет хлопотно. Вы не можете поместить это в БД, потому что это то, что вы находите ... Я бы предложил поместить это в файл конфигурации.
Dim config = ConfigurationManager.OpenExeConfiguration(Assembly.GetEntryAssembly().Location)
Dim appSettings = CType(config.GetSection("appSettings"), AppSettingsSection)
Dim insensitive = StringComparison.CurrentCultureIgnoreCase
If (Not appSettings.AllKeys.Any(Function(key)
string.Compare(key, "name", insensitive) = 0)) Then
appSettings.Settings.Add("name", "bar")
config.Save()
End If