How to get a random value from a php array?
Answer / Siddhnath Gaur
To obtain a random value from an array in PHP, you can use the array_rand() function. Here's an example:
```php
$array = array('a', 'b', 'c');
$random_index = array_rand($array);
echo $array[$random_index];
| Is This Answer Correct ? | 0 Yes | 0 No |
How to define a function with any number of arguments?
How to find datatype of variable in php?
Is php faster than python?
Write a program in php to print a table of a number?
How can we register the variables into a Session?
7 Answers HCL, Star Computers, Trikon Networks,
How is php different from other languages?
Can I include php in javascript?
What is php glob?
Why php is also called as scripting language?
How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain
How to convert one date format into another in php?
Tips to optimize the php script..... Suggestion for exception handling in php...