How do I randomise numbers in a link using PHP?

Samuel

New member
Hey, say I want my url to end with "index.php?example=567" but then want a link that randomly generates the url to "index.php?example=345" how do I do this?

So far I have done:
$numb = rand(1,567);

and then:
<a href="http://www.examplesite.com/index.php?example=<?php echo $numb; ?>">Example</a>

This does not work, why is this?
 
Back
Top