cturner Posted September 5, 2008 Share Posted September 5, 2008 I am wondering if someone could please tell me, how I can have a random multi array? This is an example of what I am after: Testimonial here Company Name here. The above must be randomly selected from an array. I will have at least 8 testimonails with company names to display, more maybe added later. I have no idea where to start with this. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
ranjuvs Posted September 5, 2008 Share Posted September 5, 2008 $testimonial = array("testmonial1","testmonial2","testmonial3","testmonial4"); $rnd = rand(0, 3); print $testimonial[$rnd]; Quote Link to comment Share on other sites More sharing options...
cturner Posted September 6, 2008 Author Share Posted September 6, 2008 I have tried your code, ranjuvs and have edited your code to suit what I am after, now it is coming up with a blank page. Here is the code which I have edited: $testimonial = array("testmonial1" => "companyname1","testmonial2" => "companyname2","testmonial3" => "companyname3","testmonial4" => "companyname4"); $rnd = rand(0, 3); print $testimonial[$rnd][$rnd]; I wanting to display the testimonial then the company name, because I am needing to make the company name a different colour to the testimonial. Could someone please tell me how I can get pass the blank page thing, and change the colour of the company name? Quote Link to comment 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.