I want to take data from an array and use the key as the name for a new array.
foreach ($row as $key => $val) {
${$key}[$val] = “chum”;
$test .= “$key - $val – $$key[$val]\n”;
}
When I print $test to see why it’s not working:
shark - 1 – $d
barracuda - 4 – $f
tuna - 3 – $e
swordfish - 3 – $s
It obviously knows what $key and $val are…why won’t it make my new array for me!!!