SHARE
TWEET

Untitled

a guest May 19th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $titles = array("Tab 1", "Tab 2", "Tab 3");
  3. $tab_content = array($titles[0] => "Tab 1 content",
  4.                     $titles[1] => "Tab 2 content",
  5.                     $titles[2] => "Tab 3 content");
  6.  
  7. if($_GET['titles']) {
  8.     $first = true;
  9.     foreach($titles as $title) {
  10.         if($first) {
  11.             echo $title;
  12.         } else {
  13.             echo "|".$title;
  14.         }
  15.     }
  16. } else if($_GET['content']) {
  17.     $desc = $_GET['content'];
  18.     echo $tab_content[$desc];
  19. }
  20. ?>
RAW Paste Data
Top