title: Convert var_dump of array back to array variable
body: <p>I have never really thought about this until today, but after searching the web I didn't really find anything. Maybe I wasn't wording it right in the search.</p>
  
  <p>Given an array (of multiple dimensions or not):</p>
  
  <pre><code>$data = array('this' =&gt; array('is' =&gt; 'the'), 'challenge' =&gt; array('for' =&gt; array('you')));
  </code></pre>
  
  <p>When var_dumped:</p>
  
  <pre><code>array(2) { ["this"]=&gt; array(1) { ["is"]=&gt; string(3) "the" } ["challenge"]=&gt; array(1) { ["for"]=&gt; array(1) { [0]=&gt; string(3) "you" } } }
  </code></pre>
  
  <p>The challenge is this: What is the best optimized method for recompiling the array to a useable array for PHP? Like an <code>undump_var()</code> function. Whether the data is all on one line as output in a browser or whether it contains the line breaks as output to terminal.</p>
  
  <p>Is it just a matter of regex? Or is there some other way? I am looking for creativity.</p>
  
  <p>UPDATE: Note. I am familiar with serialize and unserialize folks. I am not looking for alternative solutions. This is a code challenge to see if it can be done in an optimized and creative way. So <strong>serialize and var_export are not solutions</strong> here. Nor are they the best answers.</p>