title: how to update wordpress options from multi dimentional array
body: <p>Im working on a theme for wordrpess where i want to add an option admin page for the theme settings. Cant get my brain to work with the process. heres my code:</p>
  
  <pre><code>$option_settings = (array(
                  array('Section1', array(
                      array(  'ID'=&gt;'id_name1', 
                              'Label'=&gt;'Title1', 
                              'Value'=&gt;'The title1 bar',
                              'Desc'=&gt;'Description Goes Here1',
                              'Type'=&gt;'input_text',
                              'Button'=&gt;'upload'
                      ),
                  array('Section2', array(
                      array(  'ID'=&gt;'id_name2', 
                              'Label'=&gt;'Title2', 
                              'Value'=&gt;'The title2 bar',
                              'Desc'=&gt;'Description Goes Here2',
                              'Type'=&gt;'input_text',
                              'Button'=&gt;'upload'
                      ),
                  ))
  ));
  
  if (!get_option('my_option_settings')) {
  add_option('my_option_settings',$option_settings);
  }
  
  $options = get_option('my_option_settings');
  
  if ($_REQUEST['save_settings']) {
  
  //this is where my brain snaps huhu 
  
  }
  
  echo '&lt;form method="post" action="index.php" id="form_settings"&gt;';
  echo '&lt;p class="submit message"&gt;&lt;input type="submit" value="Save Changes" name="save_settings" /&gt;&lt;/p&gt;';
  foreach ($options as $section) {
  echo '&lt;h3&gt;'.$section[0].'&lt;/h3&gt;';
  foreach ($section[1] as $option =&gt; $value) {
      switch($value['Type']) {
          case "input_text":
              echo '&lt;p&gt;&lt;strong&gt;'.$value[Label].'&lt;/strong&gt; &lt;input type="text" name="'.$value['ID'].'" id="'.$value['ID'].'" value="'.$value['Value'].'" /&gt;&lt;/p&gt;';
              break;
      }
  
  }
  echo '&lt;/form&gt;';
  </code></pre>
  
  <p>my main concern here is how do i edit array inside an array and how to pass thru request. Any help is much appreciated Thanks in advance.</p>
  
  <p><strong>Updated question:</strong></p>
  
  <p>ok lets say that the $option-settings is the content of the options database from wordpress. The reason is i would like to have just 1 options in wordpress database and just store them thru array for more organize data.</p>
  
  <p>first is get the value and assign it to a variable:</p>
  
  <pre><code>$fetchOption = get_option('my_option_settings');
  </code></pre>
  
  <p>now i will edit or update the array inside $fetchOption variable.</p>
  
  <pre><code>foreach ($options as $section) {
      foreach ($section[1] as $option =&gt; $value) {
          $value['Value'] = [$_POST[$value['ID']]];
  
      }
  
  }
  </code></pre>
  
  <p>Last is how to put back the changed value into the $fetchOption variable and update back the database using update_options('my_option_settings', $fetchOption). </p>
  
  <p>Is this appropriate or not? whats the best practice for this? I could just assign them to 1 option but its kinda messy i guess. thanks again!</p>