我有以下格式的数组(每个子数组都有父键作为前缀):
$input = array(
'seo_text' => array(
'seo_text_title' => '',
'seo_text_description' => '',
'seo_text_button' => array(
'seo_text_button_text' => '',
'seo_text_button_url' => '',
'seo_text_button_new_tab_enabled' => '',
),
),
);
Run Code Online (Sandbox Code Playgroud)
我想将其转换为以下格式:
$input = array(
'seo_text' => array(
'title' => '',
'description' => '',
'button' => array(
'text' => '',
'url' => '',
'new_tab_enabled' => '',
),
),
);
Run Code Online (Sandbox Code Playgroud)
我正在尝试编写一个递归函数,但是它没有按照预期的方式工作。