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 Quote 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" />'; ?> Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.