An efficient way to show a random value from an array, using PHP's array_rand() functions.
1. $Numbers = array(4, 8, 15, 16, 23, 42);
2. echo $Numbers[array_rand($Numbers)]; // Will output a random number picked from the six above
An efficient way to show a random value from an array, using PHP's array_rand() functions.
1. $Numbers = array(4, 8, 15, 16, 23, 42);
2. echo $Numbers[array_rand($Numbers)]; // Will output a random number picked from the six above