RE: [PHP] displaying string combinations
| From: | Jack Dempsey | Date: | Fri, 20 Apr 2001 07:13:02 +0000 |
| Subject: | RE: [PHP] displaying string combinations | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49518@lists.php.net to get a copy of this message | ||
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:iftikhar@pacbell.net]
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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net