注意,这里使用了 (i+1),因为数组中第一个元素的索引号是 0,要从第一个元素开始,必须加上 1。
Note that you use (i+1) because in the array, the counter value of the first element is zero; as you want to start with the first element, the 1 is added.
比如,你有没有发现在数组索引里没有用引号将字符串括起来?
For instance, did you notice that there were no single quotes around the array indexes ($x[sales] and $x[profit])?
应用推荐