I have 6 color codes to use for my web site. $color1="black"; $color2="white"; ..etc
I want to know the code to choose a random color.
Use a switch or associative array and the ran() function to generate a mapping. You'll probably aslo want to use sran() to seed rand() so it dones't do the same thing each time.