Is this the proper construct of my wannabe associative array or is there a better method to this?
Each ID key is associated with a value, in this case ID is Nickels(index key) with a value of “5”, assigned to the variable $money1.
$money1['Nickels'] = "5";
$money2['Dimes'] = "10";
$money3['Quarters'] = "25";
Yes. It’s correct. Assuming, you want to have 3 arrays in the end (
money1,money2,money3).If you want one array, you can use this compact notation:
.. which is a shorter form of:
Array access: