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 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] . '" />'; 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! Link to comment https://forums.phpfreaks.com/topic/160714-solved-php-link/#findComment-848175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.