title: Array from form - Wordpress Metadata
body: <p>I got a custom post type, with a form for storing some data (name, url) to display in a template.</p>
  
  <p>What I want to know is <strong>how can I store those values in an array</strong>?</p>
  
  <p>An example of my code:</p>
  
  <pre><code>&lt;? function files_metadata(){  
          global $post; 
          $custom = get_post_custom($post-&gt;ID);  
          $name = $custom["name"][0];
          $url = $custom["url"][0];
  
          echo '&lt;input type="hidden" name="files_metadata" id="files_metadata" value="' .wp_create_nonce('files_m'). '" /&gt;'; ?&gt;  
  
  &lt;label&gt;Name: &lt;/label&gt;&lt;br/&gt;
  &lt;input id="name" name="name" value="&lt;?php echo $name; ?&gt;" /&gt;
  &lt;label&gt;Url: &lt;/label&gt;&lt;br/&gt;
  &lt;input id="url" name="url" value="&lt;?php echo $url; ?&gt;" /&gt;
  
  &lt;? function save_meta_files($post_id) {  
          if (!wp_verify_nonce($_POST['files_metadata'], 'files_m')) return $post_id;
          if (defined('DOING_AUTOSAVE') &amp;&amp; DOING_AUTOSAVE) return $post_id;
  
          update_post_meta($post_id, "name", $_POST["url"]);   
          update_post_meta($post_id, "url", $_POST["url"]); 
      }  
  
  add_action('save_post', 'save_meta_files'); ?&gt; 
  </code></pre>
  
  <p>To this I want to add something like...</p>
  
  <pre><code>$url = $custom["url"][0];
  $url2 = $custom["url"][1];
  $url3 = $custom["url"][2];
  
  &lt;input id="url" name="url[0]" value="&lt;?php echo $url; ?&gt;" /&gt;
  &lt;input id="url2" name="url[1]" value="&lt;?php echo $url2; ?&gt;" /&gt;
  &lt;input id="url3" name="url[2]" value="&lt;?php echo $url3; ?&gt;" /&gt;
  
  update_post_meta($post_id, "url", $_POST["url"][0]); 
  update_post_meta($post_id, "url2", $_POST["url"][1]); 
  update_post_meta($post_id, "url3", $_POST["url"][2]); 
  </code></pre>
  
  <p>...but that actually works... </p>