Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array random php

<?php
$indexedArray = array("red", "blue", "green", "black");

echo $indexedArray[0] . "<br>";
echo $indexedArray[1] . "<br><br>";

$array_random = array_rand($indexedArray, 2);

echo $indexedArray[$array_random[0]] . "<br>";
echo $indexedArray[$array_random[1]] . "<br>";
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #array #random #php
ADD COMMENT
Topic
Name
3+7 =