title: PHP form array notation, reversed?
body: <p>So, I have this form that is rather complicated, and the form fields are named to comply with PHP array notation, as such:</p>
  
  <pre><code>&lt;input name='service[123][info]' value=''&gt;
  </code></pre>
  
  <p>And this of course works as intended and I get the array in $_POST, which I sanitize and then keep in $in. But now I want to reverse-engineer this, when I am iterating over the form again, I have this in $in:</p>
  
  <pre><code>array(
    123 =&gt; array(
      "info" =&gt; "foo"
    )
  )
  </code></pre>
  
  <p>And when I come to any given form field, I know that the field name is "service[123][info]" but how do I find "foo" in the sent array? Basically, I want to set the value="" parameter in the input when I have data for this field, and the data is kept in the $in array but the only reference to the data I have is the string "service[123][info]". Should I use regexp to parse that string? Sounds inflexible.</p>
  
  <p>Basically, I would like something like:</p>
  
  <pre><code>$name = "service[123][info]";    
  $value = form_array_lookup($name, $in);
  </code></pre>
  
  <p>That sets $value to the correct value from $in as referenced by $name. I hope I am making myself clear. Thanks for any comment.</p>