多维数组帮助 - 以及关于数组的其他问题 [英] Multi-Dimensional Arrays Help - And Other Questions on Arrays
本文介绍了多维数组帮助 - 以及关于数组的其他问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
出于某种原因,我总是很难理解数组,因为它们与php和数据库有关。我理解关联数组就好了但是当有多维数组时,我有点不会。
我已经讨论了几个不同的例子,但它们是有限的。我能够找到一条我想要解析的代码并提出问题,这样我就可以更好地理解。
展开 | 选择 | Wrap | 行号
解决方案
首先,发布的代码应该给你很多错误通知(键被设置为常量,我怀疑是有意的)
如果你熟悉数学,想象数组作为矩阵,你可以用适当的索引(又称键)值访问每个元素(比如
array
I]
For some reason, I have always had a hard time understanding arrays as they pertain to php and databases. I understand associative arrays just fine but when there are multidimensional arrays, I kinda don''t.
I have gone over a few different examples but they were limited. I was able to find one piece of code that I would like to disect and ask questions about so I can gain a better understanding.
Expand|Select|Wrap|Line Numbers解决方案firstly, the posted code should give you quite a bunch of error notices (the keys are set as constants, which I doubt are intended)
if you''re familiar with Maths, imagine arrays as matrices where you can access each element with the appropriate index (aka key) values (like
array
i]
这篇关于多维数组帮助 - 以及关于数组的其他问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆