본문 바로가기

스크립트/Php 코드 팁

간단하게 랜덤 숫자 뽑아오기

mt_srand ((double)microtime ()*1000000);
$result = mt_rand (0,2);  // 0부터 2까지

echo [$result];