Okay so the array is $nv = array();
$nv[$kk] = $value;
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?
But what if I did this:
$nv[$kk][$jj] = $value;
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.
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?
Question#2: What else can you do with this structure that seems, so very powerful, unless if I am wrong?
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.
$nv = array();
foreach($vars as $key => $value)
{
$kk = "#".strtoupper($key)."#";
$nv[$kk] = $value;
}
unset($vars);
$tdata = strtr($nv,$tdata);
return true;
Or from php.net
A multi-dimensional array, okay, so the first index can be for row and the second for column in terms of accessing "a"?
$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";
}
}
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.