The array number is passed to the value form, but you need to pass a non-integer number. How to do it? For example 1.82

<?php $city = array ( 'Местные розы' => array ( 'quantity' => array ( 11 => '11 шт. (минимум)', 25 => '25 шт.', 51 => '51 шт.', 101 => '101 шт.', ), 'lengths' => array ( 60 => '60 см', 70 => '70 см', ), ), 'Эквадорские розы' => array ( 'quantity' => array ( 25 => '25 шт. (минимум)', 51 => '51 шт.', 76 => '76 шт.', 101 => '101 шт.', ), 'lengths' => array ( 1.82 => '50 см', 60 => '50 см', 70 => '70 см', ), ), ); ?> 

    1 answer 1

    An array key can only be an integer ( integer ) or a string ( string ) .
    Therefore, convert float to a string and you will have a working key.

    • How to do it?) - bakusite
    • one
      @bakusite, (string) $yourFloatKey . - user207618