I want to select a random value from a array, but keep it unique as long as possible.
For example if I\'m selecting a value 4 times from a array of 4 elements, the s
$isShowCategory = array(); for ($i=0; $i <5 ; $i++) { $myCategory = array_rand($arrTrCategoryApp,1); if (!in_array($myCategory, $isShowCategory)) { $isShowCategory[] = $myCategory; #do something } }