Skip to content
Advertisement

PHP – How to add more than 2 parameters to a variable?

So I have the following code:

JavaScript

But it outputs this error:

Warning: rand() expects exactly 2 parameters, 10 given…”

So I wonder how could I random the values of this variable and then print() only on in the p tag?

Advertisement

Answer

Since your numbers are in sequence, you could simply do

JavaScript


Function Prototype:

int rand ( int $min , int $max )

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement