Home / PHP Tips Generated By ChatGPT / Generating Random Numbers in PHP Generate random numbers within a specific range using rand(). Source Code echo rand(1, 10); // Outputs a random number between 1 and 10