mt_rand(10,100) を使用して 10 から 100 の間の乱数を取得していますが、毎回 74 になります。
これが私が取り組んでいるものです
$success=mt_rand(10,100);
何か案は ?どういうわけかシードする必要がありますか? 前もって感謝します。
- -編集 - -
私はちょうどこれを試しました
srand(microtime());
$success=rand(10,100);
それでも毎回同じ答えが返ってきます、47.
- -編集 - -
これが全体です
srand(microtime());
$success=rand(10,100);
echo $success;
if ($success == 100) {
$displayline="You succeeded";
session_register("displayline");
header("location:userhome.php");
}