Milbea Posted August 20, 2007 Share Posted August 20, 2007 I'm in the process of making a random chance game. How can I make the different outcomes have their own picture? Here's the code: <?php; srand((double)microtime()*1000000); $numb=rand(0,100); if ($numb>=75) echo "Big Win"; elseif ($numb<=50) echo "lose"; else echo "dude"; ?> thanks Link to comment https://forums.phpfreaks.com/topic/65849-solved-images-with-if-elseif/ Share on other sites More sharing options...
lead2gold Posted August 20, 2007 Share Posted August 20, 2007 <?php; srand((double)microtime()*1000000); $numb=rand(0,100); if ($numb>=75) echo '<img src="bigwin.png" />'; elseif ($numb<=50) echo '<img src="bigloss.png" />'; else echo '<img src="dude.png" />'; ?> Link to comment https://forums.phpfreaks.com/topic/65849-solved-images-with-if-elseif/#findComment-329076 Share on other sites More sharing options...
Milbea Posted August 20, 2007 Author Share Posted August 20, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/65849-solved-images-with-if-elseif/#findComment-329078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.