作者:jiuyueling | 来源:互联网 | 2023-08-11 07:14
Imtryingtocreateanarraywith100randomvaluesfrom1to1000,andmultiplyeachby4我试图创建一个10
Im trying to create an array with 100 random values from 1 to 1000, and multiply each by 4
我试图创建一个100个随机值从1到1000的数组,并将每个乘以4
so far I have:
到目前为止我有:
$numbers = array(rand(1, 1000),rand(1, 1000),rand(1, 1000),
rand(1, 1000),rand(1, 1000),rand(1, 1000)
for($x=0; $x<100; $x++)
echo $numbers[$x]*4 . "
";
How do I get rand(1,1000) to repeat 100 times without copy pasting? thanks!
如何在没有复制粘贴的情况下让rand(1,1000)重复100次?谢谢!
4 个解决方案