Skip to content

Instantly share code, notes, and snippets.

@freaktechnik
Created April 5, 2015 00:22
Show Gist options
  • Save freaktechnik/3a2cd0d776fce233a688 to your computer and use it in GitHub Desktop.
Save freaktechnik/3a2cd0d776fce233a688 to your computer and use it in GitHub Desktop.
$index = 0;
if(count($this->randomTileWeight) > 0) {
$index = $this->randomTileWeight[array_rand($this->randomTileWeight)];
$this->randomTileWeight = array_filter($this->randomTileWeight, function($item) {
return $item != $index;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment