Home / PHP Tips Generated By ChatGPT / Generating a Random Float Number in PHP Create a random float number between 0 and 1 with mt_rand() and division. Source Code echo mt_rand() / mt_getrandmax();