PHP probability operation function
[code]/**
* total probability calculation of
*
* @param array $p array ('a'=.gt; 0.5,'b'=.gt; 0.2,'c'=.gt; 0.4) returned to the above array. Static $arr = array (); $key = MD5 (serialize ($ps));
if ($arr.#91; $key.#93;). }
>}
return $arr.#91; $key.#93;.#91; mt_rand (0, count ($arr.#91; $key.#93;) -1);