PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
nick2
Forum Contributor
Posts: 118 Joined: Fri Jul 25, 2003 2:34 pm
Post
by nick2 » Wed Oct 15, 2003 9:52 pm
help,
Code: Select all
<?php
$color = Array("Green", "Blue", "Black", "orange", "silver", "gold");
shuffle($color);
print $color
?>
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Thu Oct 16, 2003 4:08 am
Which operating system are you using? shuffle() had me pulling my hair out when using it on Windows.
Mac
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Thu Oct 16, 2003 6:15 am
Code: Select all
<pre>
<?php
$color = Array("Green", "Blue", "Black", "orange", "silver", "gold");
shuffle($color);
print_r($color); // you had this part wrong...
?>
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Thu Oct 16, 2003 6:56 am
Shows why it's always useful to state exactly what the problem is instead of just posting code...
Mac
evilMind
Forum Contributor
Posts: 145 Joined: Fri Sep 19, 2003 10:09 am
Location: Earth
Post
by evilMind » Thu Oct 16, 2003 7:48 am
Actually as of PHP 4.2.0 there is no need to seed the random number generator.
http://php.net/srand
nigma
DevNet Resident
Posts: 1094 Joined: Sat Jan 25, 2003 1:49 am
Post
by nigma » Thu Oct 16, 2003 5:54 pm
I must go away for years and years before I reply to another topic. Second time I have attempted to help without knowing what I am doing.