PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $arr = array(true,true,false,false,true,false); $res = array_keys($arr, true); var_dump($res); // returns 0,1,4 echo $res[array_rand($res)]; //echo one of the indexes that is true ?>
Show:  
Copy Clear