2DWorlds Forums
PHP: A Cool Little Thing For a Site - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: PHP: A Cool Little Thing For a Site (/showthread.php?tid=4541)



PHP: A Cool Little Thing For a Site - Chaos - 05-10-2011

I wanted to code up something quick to learn some new functions on PHP. I came across the 'rand' function and this is what happened:

I know it's sloppy, I did this quick.

<html>
<body>
<?php //Random number generator WOOOO

//Generate the numbers
$n1 = rand (1, 99);
$n2 = rand (1, 99);
$n3 = rand (1, 99);

//Outcome
print "<p>Your Lucky numbers are...<br />
$n1<br />
$n2<br />
$n3</p>";

?>
</html>