我有 json 数据,可以这样说
$string='[{"main_menu_id":"1","main_menu_caption":"Home","main_is_get_from_page":"0","is_sub_menu":"0","main_url_page":"","sub_menu_caption":"","caption_type":"","sub_is_get_from_page":"","sub_url_page":"","sub_additional_param":""}]';
如何仅在此 json 数据中获取字段名称?我期望的结果是 main_menu_id、Main_menu_caption 等。我需要提取键名而不是值