Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Return a random key from an array:
SUBMITTED BY:
henry1874w
DATE:
June 25, 2017, 2:37 p.m.
FORMAT:
Text only
SIZE:
99 Bytes
Raw
Download
Tweet
HITS:
223
Go to comments
Report
<?php
$a=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
print_r(array_rand($a,1));
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus