数组数据操作和检索


array data manipulation and retrieval

我有一个多维数组:

我用$array= call_user_func_array('array_merge', $array);

把它平了一级

现在当我尝试使用

访问日期时
foreach($array as $field)
{
   echo $field['Section_title'];      // echo id 
}

我通过所有嵌套数组获得结果,但我只想引用每个单独的数组。我要的不是1号,而是2号。有人能教我如何正确地阅读和引用嵌套数组吗?

1。{条件和症状、紧急联系人等}

2。{条件和症状}

数组

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [Section_title] => Conditions and Symptoms
                    [section_subtitle] => Does the patient have 
                    [additional_info] => 
                    [section_disclaimer] => 
                    [disclaimer_title] => 
                    [section_makercol] => 
                    [field_title_1] => Tuberculosis
                    [field_title_2] => Chronic cough
                    [field_title_3] => Asthma
                    [field_title_4] => Diabetes
                )
            [1] => Array
                (
                    [Section_title] => Emergency Contacts
                    [section_subtitle] => 
                    [additional_info] => 
                    [section_disclaimer] => 
                    [disclaimer_title] => 
                    [section_makercol] => 
                    [field_title_1] => Name
                    [field_title_2] => Phone #
                    [field_title_3] => Address
                    [field_title_4] => City
                )
            [2] => Array
               ( 
               )
)

可以遍历键值:

foreach($array as $field)
{
   foreach ($field as $key => $value){
       echo $field[$key]; //
   }
}