grahamb314 Posted June 2, 2009 Share Posted June 2, 2009 Hi all, I think im missing something silly here <?php $array = array("/black.jpg", "/white.jpg"); $randnumber= rand(0,count($array)-1); echo'<img src="$array[$randnumber]" />; ?> I'm trying to get $array[$randomnumber] to be part of the url. Any thoughts? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/160714-solved-php-link/ Share on other sites More sharing options...
Alex Posted June 2, 2009 Share Posted June 2, 2009 echo '<img src="' . $array[$randnumber] . '" />'; Quote Link to comment https://forums.phpfreaks.com/topic/160714-solved-php-link/#findComment-848164 Share on other sites More sharing options...
grahamb314 Posted June 2, 2009 Author Share Posted June 2, 2009 echo '<img src="' . $array[$randnumber] . '" />'; TY! Quote Link to comment https://forums.phpfreaks.com/topic/160714-solved-php-link/#findComment-848175 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.