当我给$ error数组索引[' 1']时,它开始以索引1开始?为什么会这样?

时间:2016-05-02 18:29:30

标签: php

<label class="item item-input">
        <span class="input-label">Name:</span>
        <input ng-model="name" type="text" placeholder="your name">
    </label>
<button class="button button-large button-full button-assertive" ng-click="closeCart()">Pagar</button>

1 个答案:

答案 0 :(得分:0)

这种情况正在发生,因为它是预期的行为。观察到的行为符合规范。

参考:http://php.net/types.array

摘录:

  

密钥可以是整数或字符串。值可以是任何类型。

     

此外还会发生以下关键演员:

     
      
  • 包含有效整数的字符串将强制转换为整数类型。例如。键“8”实际上将存储在8下。
  •