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