I was working on a new Guild Wars web game for Photics.com, but I hit a snag. See... not only do I hate the refresh tag, I am not allowed to use it with certain advertisements. So, by eliminating the refresh tag, a plain static page would appear over and over. I was thinking some random text would make the game feel more dynamic... kinda like the loading screen in Neverwinter Nights or Knights of the Old Republic.
The problem? I'm no coder. I'm something like the Borg of web design. I find new technology and assimulate it into my own website. Yet, that's just not going to fly if I'm going to be making new games. Sooooooooooo... Nemi heard about what was going on. That's when he told me about the rand() command in PHP.
I'm still fuzzy on the whole writing my own code thing. But based on what Nemi said, I did manage to come up with this...
Code:
<?php
$array[0] = "Hi Nemi!";
$array[1] = "What calls us is victory!";
$array[2] = "This is randomly created text!";
$array[3] = "DON'T LOOK AT ME!";
$array[4] = "Buy Mike's book!";
$randomVar = rand(0, 4);
echo $array[$randomVar];
?>
Now... I can drop that into the game for a dynamic effect. :)
Wooo hooo... I'm learning PHP :lol: