Jump to content

Randomize by percentage


gibigbig

Recommended Posts

I am making an online game and when making a character, I want the gender chosen to be random, but controlled by a percentage.

 

Example:

$male = 80; // in %
$female = 20; //in %

   

Is there a function that will output "male" or "female" depending on the percentage of odds. Or do I have to make my own

Link to comment
https://forums.phpfreaks.com/topic/243382-randomize-by-percentage/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.