There is a multidimensional array that needs to be changed in accordance with the key, but I can’t do so in any way so that the key is outputted here:

Array ( [0] => Array ( [0] => 52 [1] => #FF00FF [2] => XL [3] => 26 [4] => 0 [5] => 0 [discount-size] => 50 ) [1] => Array ( [0] => 52 [1] => #FF00FF [2] => S [3] => 25 [4] => 0 [5] => 0 [discount-size] => 50 ) [2] => Array ( [0] => 52 [1] => #A0522D [2] => XL [3] => 24 [4] => 0 [5] => 0 [discount-size] => 50 ) [3] => Array ( [0] => 52 [1] => #A0522D [2] => S [3] => 23 [4] => 0 [5] => 0 [discount-size] => 50 ) ) 

Here is the output function:

 foreach ( $array as $movie ) { echo $movie[1]; echo movie[2]; т.д } 

    1 answer 1

     foreach ( $array as $key => $movie ) { echo $key; }