title: Code Challenge: Convert var_dump of array to json
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 a nested array where var_dumped</p>
  
  <pre><code>&lt;pre&gt;array(3) { 'id' =&gt;  string(19) "as-agent-to-shipper" 'name' =&gt; string(19) "as-agent-to-shipper" 'children' =&gt; array(1) {
  [0] =&gt;
  array(3) {
    'id' =&gt;
    string(28) "agility-logistics-s-a-de-c-v"
    'name' =&gt;
    string(30) "AGILITY LOGISTICS S.A. DE C.V."
    'data' =&gt;
    array(2) {
      'band' =&gt;
      string(22) "-AS AGENT TO SHIPPER -"
      'relation' =&gt;
      string(13) "Buyer of band"
        }
      }
    }
  }
  </code></pre>
  
  <p></p>
  
  <p>The challenge is this: What is the best optimized method for converting a var_dumped array to json?
  Is it just a matter of regex? Or is there some other way? I am looking for creativity.</p>