<?php
//第一种 法
$rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
$color = '#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
//第二种方法
printf( "#%06X\n", mt_rand( 0, 0xFFFFFF ));
?>
本文来自投稿,不代表本站立场,如若转载,请注明出处:https://www.unfit.cn/archives/53.html