Well, first, you can’t retrieve a key without setting that key. That means that you can not echo a
key such as $val[“name”] without setting it first.
Next, if you use blank keys, you need to use them to retrieve the data. What I am talking about is your
assignments of the posted values for name and qty. You do not set a key when you assign them to the
$test[] array. Therefore, you are just placing values into it and no keys. This is actually a good thing as
it saves a lot of storage, but, you would need to use a different format to retrieve the data. You can do
this with multiple indices such as $test[][]…
Arrays are normally saved using the “key”==> “value” format. So, if you wish to be able to pull the values
for a “key” you need to store that key name also. Like $test[“name”]=$_POST[“name”]; Then, you can get
it back the way that you did in your code.
To preview your data, you can display the arrays using the print_r function or the var_dump function.
Just print_r($_SESSION[“images”]); or var_dump($_SESSION[“images”]); These show your layout of
your arrays, one just shows the data and one shows the structure. I would suggest debugging it a little
and see what you are storing into your array and I think it will make better sense to you.