Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1.   /**
  2.    * Randomly generates a price in the range (min,max).
  3.    *
  4.    * @param min - the min value
  5.    * @param max - the max value
  6.    * @return a randomly generated price value
  7.    */
  8.   private function generateRandomPrice($min = 1, $max = 100)
  9.   {
  10.     $random_price = $min + rand() / getrandmax() * ($max - $min);
  11.     return round($random_price, 2);
  12.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement