why not do this:
//generate your random number and save it in $randomNumber
switch($randomNumber){
case 1:
echo "$banner1";
break;
case 2:
echo "$banner2";
break;
case 3:
echo "$banner3";
break;
case 4:
echo "$banner4";
break;
}
-jack
-----Original Message-----
From: Ray Iftikhar [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 3:03 AM
To: Php-General List
Subject: [PHP] displaying string combinations
hello,
I have a bunch of "Banner" strings (ie. $banner1, $banner2, $banner3,
$banner4). I have another set of "random" strings that randomly generate a
value 1-4 ($RandBanner1, $RandBanner2, $RandBanner3,$RandBanner4). Now I
want to display $banner1-4 randomly. I plan on doing this by:
print "$banner".$RandBanner1;
but that doesnt seem to work...Anyone got any other suggestions?
Any help is greatly appricaited.
Thanks in advance,
Ray
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]