我想将n个课程的课程标记存储到n个变量中,例如cw1和cw2等.使用变量变量如何提供cw1,cw2等.
I want to store courseworks marks of n courseworks into n variables, such as cw1 and cw2 etc. Using variable variables how can I come with cw1, cw2 etc.
如何动态创建变量?
推荐答案使用数组代替:
PHP中的 array 实际上是有序映射.映射是一种将值与键相关联的类型.该类型已针对多种不同用途进行了优化.它可以被视为数组,列表(向量),哈希表(地图的实现),字典,集合,堆栈,队列,甚至可能更多.由于 array 的值可以是其他数组,树和多维数组也可以...
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible...
更多推荐
PHP变量变量
发布评论