Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to create a 4-digit number using PHP is to use the rand() function to generate a random number between 1000 and 9999.

Here is an example:

$four_digit_number = rand(1000, 9999);
echo $four_digit_number;

This code will generate a random four-digit number and print it to the screen.