ap_rand( integer $min, integer $max, weight $weight )
Description #
Utility function for getting random values with weighting.
Parameters #
- $mininteger (Required) Minimum integer.
- $maxinteger (Required) Maximum integer.
- $weightweight (Required) Weight of random integer.
Source #
File: includes/functions.php
function ap_rand( $min, $max, $weight ) { $offset = $max - $min + 1; return floor( $min + pow( lcg_value(), $weight ) * $offset ); }
Expand full source code Collapse full source code View on GitHub: includes/functions.php:1982
anspress.io is fantastic, i will come back here for sure