php数组从1到200的任何快速方式


php array from 1 to 200 any fast way?

可能重复:
在php 中用不带循环的值填充数组

我买了一个php联系人表单,我正在尝试制作一个验证器。因此,与其这样键入:

$amount->addValidator('identical', array( 
'token' => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35')

));

有没有什么快速的方法可以将其作为有效答案,范围从1到200?我打了35,累了。

$array = range(1, 200);

http://us2.php.net/manual/en/function.range.php

您可以使用范围函数生成包含1到200个元素的数组

$arr = range(1,200);