How to use an array for this?

Discussion in 'PHP' started by megler, Nov 24, 2008.

  1. #1
    Hi everyone!

    I know how to use an array to rotate items, but I need to do something slightly more complicated:

    [​IMG]

    What I want to do is rotate the top row with the bottom row when the page is refreshed. I think I can do it with seperate arrays, but I'm not sure how to set it up. The only way I now how to set up an array is this:

    <?php
    $links = array(’http://www.link1.com’,'http://www.link2.com’);
    $link = $links[array_rand($links)];
    echo “<meta http-equiv=’refresh’ content=’0;url=$link’/>”;
    ?> 
    PHP:
    How would I change this so that it would flip the table contents back and forth?

    Thanks!
     
    megler, Nov 24, 2008 IP
  2. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #2
    If there's only 2, do a if else statement.
     
    Kaizoku, Nov 24, 2008 IP