note 19243 added to function.mt-srand

From: Date: Wed, 20 Feb 2002 18:52:47 +0000
Subject: note 19243 added to function.mt-srand
Groups: php.notes 
Request: Send a blank email to php-notes+get-26859@lists.php.net to get a copy of this message
list($usec,$sec) = explode(" ",microtime()); /* Test: Each get rand sequence are 10time. */ /* ex) 5.3point meaning 5point integer + 3point decimal // case A: // 5.0point - 1time // 6.0point - 9time $rand = (double)microtime()*1000000; // case B: // 8.6point - 1time // 9.4point - 1time // 9.5point - 7time // 10.3point - 1time $rand = (double)$sec * $usec; // My case A: // 8.0point - 10time $rand = explode(".",$usec * $sec); $rand = $rand[0] * $rand[1]; $rand = (double)substr($rand,0,8); // My case B: // 9.0point - 9time // 10.0point - 1time $rand = explode(".",$usec * $sec); $rand = $rand[0] + $rand[1]; $rand = (double)microtime()*1000000; mt_srand($rand); srand($rand); -- http://www.php.net/manual/en/function.mt-srand.php http://master.php.net/manage/user-notes.php?action=edit+19243 http://master.php.net/manage/user-notes.php?action=delete+19243 http://master.php.net/manage/user-notes.php?action=reject+19243

« previous php.notes (#26859) next »