Php 如何生成如下所示的动态数字数组
我想生成上面例子中的动态数字数组,最多10000个。对于数组Php 如何生成如下所示的动态数字数组,php,arrays,dynamic,Php,Arrays,Dynamic,我想生成上面例子中的动态数字数组,最多10000个。对于数组$big\u box尝试这样的方法 $big_box = array(1,2,3,16,17,18,31,32,33,46,47,48,61,62,63,76,77,78,91,92,93,106,107,108,121,122,123,136,137,138............); $small_box = array(4,19,34,49,64.............); 这些数字是随机的吗?或者有订单吗?没有,它将按
$big\u box
尝试这样的方法
$big_box = array(1,2,3,16,17,18,31,32,33,46,47,48,61,62,63,76,77,78,91,92,93,106,107,108,121,122,123,136,137,138............);
$small_box = array(4,19,34,49,64.............);
这些数字是随机的吗?或者有订单吗?没有,它将按照相同的示例顺序。你能帮我还$small_box吗?我已经上传了这两个。请检查谢谢莫塔·拜:)
$j = 0;
for ($i=0; $i <= 1000; $i++) {
if ($i!=0) {
$big_box[] = $i;
$j++;
}
if ($j == 3) {
$j = 1;
$big_box[] = $i+13;
$i =$i+13;
}
}
echo "<pre>";
print_r($big_box);
$small_box = array();
for($i=0; $i <= 1000; $i++) {
if ($i == 0) {
$small_box[$i] = 4;
}else{
$small_box[$i] = $small_box[$i-1]+15;
}
}
echo "<pre>";
print_r($small_box);