Tags
PHP
Asked 8 years ago
28 Sep 2016
Views 1214
Phpworker

Phpworker posted

rand() vs mt_rand() in php

i mostly use rand() function to generate random number
rand(1,1333);

but i seen people using mt_rand also

so my question is both rand() and mt_rand() are same or any difference ?
if same why created two functions ?
jagdish

jagdish
answered Nov 30 '-1 00:00

mt_rand() function is fast to run in respect to rand() function

so use mt_rand where performance is matter
Post Answer