Variables as index keys?
<p>Okay so the array is $nv = array();</p>

<p>$nv[$kk] = $value;</p>

<p>And index key is $kk a variable.
If you have $kk  then you can access them as the variables $kk via the index key
$kk?</p>

<p>But what if I did this:</p>

<pre><code>$nv[$kk][$jj] = $value;
</code></pre>

<p>I can now access the variables $kk and $jj both assigned to $value, even though they are
index keys, sounds powerful and scary at the same time.</p>

<p>Question#1: I am a noob and was just wondering if this is the correct interpretation of the code above; furthermore, what are the benefits of this structure?</p>

<p>Question#2: What else can you do with this structure that seems, so very powerful, unless if I am wrong?</p>

<p>Apparently just copying the entire structure "$nv[$kk][$jj] = $value;" into Google does not yield significant results and most examples on php arrays don't seem to really explain this in detail.</p>

<pre><code>  $nv = array();
  foreach($vars as $key =&gt; $value)
  {
    $kk = "#".strtoupper($key)."#";
    $nv[$kk] = $value;
  }
  unset($vars);
  $tdata = strtr($nv,$tdata);
  return true;
</code></pre>

<p>Or from php.net</p>

<p>A multi-dimensional array, okay, so the first index can be for row and the second for column
in terms of accessing "a"?</p>

<pre><code>$a = array();
$a[0][0] = "a";
$a[0][1] = "b";
$a[1][0] = "y";
$a[1][1] = "z";

foreach ($a as $v1) {
    foreach ($v1 as $v2) {
        echo "$v2\n";
    }
}
</code></pre>

<p>Just need some clarification, I am trying to build a solid foundation for my understanding of php concepts, thank you in advance, please no flaming for the noob.</p>
