Jump to content

Random multi array


cturner

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.