在PHP是有递增后续值的PHP的阵列输出问题
值的函数两次基于初始值(* 2)以阵列
列?
$beta = array(
array('5', '1''1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2'),
array('5','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','2')
);
/*Example: '5' will be '10' (5*2 =10 and output 10 to web)
'2' will be '4' (2*2 = 4 and output 4 to web)
The next '2' will be '16' (4*2 = 8 and output 8 to web)
The next '2' will be '32' (8*2 = 16 and output 16 to web)
And so forth? */
而且有构造此阵更简单的方法,因为我坚信有,但不是在结构方面太复杂,使得小白不会理解它,再次感谢。
[免责声明:我花了3天的时间来理解数组,我现在明白了;然而,我仍然是新手,目前在尝试操作数组中的值并将其输出到网络时遇到了一些问题。而且我仍然确信我有很多需要阅读和学习的内容,所以请不要使用flamers,我只是需要一些帮助,找到了这款C这个问题++的书:
您在第一个子数组中缺少逗号。 ;) – MitMaro 2009-11-16 12:25:11