在PHP腳本中引入隨機性的技巧有以下幾種:
$randomNumber = rand(1, 100);
$myArray = array(1, 2, 3, 4, 5);
shuffle($myArray);
$randomNumber = mt_rand(1, 100);
$myArray = array('apple', 'banana', 'cherry', 'date');
$randomElement = $myArray[array_rand($myArray)];
$str = 'hello';
$strArray = str_split($str);
shuffle($strArray);
$randomStr = implode('', $strArray);