title: PHP set and get multi-dimentional array values
body: <p>I have a PHP class as follows:</p>
  
  <pre><code>Class ArrayStore{
  
  static $storage = array();
  
  public static set($key, $value){
    //set value
  }
  
  public static get($key){
    //return value
  }
  
  }
  </code></pre>
  
  <p>How I want to use:</p>
  
  <pre><code>ArrayStore::set('["id"]["name"]["last"]', 'php');
  ArrayStore::get('["id"]["name"]["last"]'); //should return php
  
  ArrayStore::set('["multi"]["array"]', 'works');
  ArrayStore::get('["multi"]["array"]'); //should return works
  </code></pre>
  
  <p>Let me know if there is a better way of setting and getting a multidimensional array with reason.</p>
  
  <p>Edit:
  I tried something like this:</p>
  
  <pre><code>&lt;?php
  $x = array(1=&gt;'a');
  $op="\$x"."[1]";
  $value=eval("return ($op);");
  
  echo $value;//prints a.
  ?&gt;
  </code></pre>