Home > Backend Development > PHP Tutorial > php获取下一个随机数

php获取下一个随机数

WBOY
Release: 2016-06-13 12:57:09
Original
860 people have browsed it

php获取上一个随机数
php获取上一个随机数

  echo ".rand(10000, 9999900000000000).";   
}
?>

这个是随机显示一个组数  比如刷新获取的是 2222222

那个我要调用这个2222222 应该怎么办?


------解决方案--------------------
保存上一个随机数不就可以了啊

------解决方案--------------------
  $temp=rand(10000, 9999900000000000);
  echo $temp;   
}
?>
------解决方案--------------------
<br />
/*如果你需要的是一组随机数,那么可以考虑将随机数存储在数组中<br />
如果你的随机数,需要跨页面传送那么建议你存在全局数组SESSION中*/<br />
<?php session_start();<br />
$t=rand(1000,7000);<br />
$_SESSION[]=$t;<br />
print_r($_SESSION);<br />
?><br />
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template