title: How can I make Codeigniter function variables globally available?
body: <p>I am working on a simple game where the user will randomly be generated a bingo board. Once they initialize the game (i.e. round 1 after clicking "start" on index.php), the code starts using a new controller (bingo_play.php). This controller tracks the tiles that have been marked and the information in each tile.</p>
  
  <p>Here's the code: </p>
  
  <pre><code>$card['products'] = array(
      1 =&gt; 'hamburger',
      2 =&gt; 'fries',
      3 =&gt; 'soda',
      4 =&gt; 'taco',
      5 =&gt; 'bacon',
      6 =&gt; 'onions',
      // etc.
  );
  
  if ($card['card_number'] == 1)
  {
      $card['card_entries'] = array(
          'a1' =&gt; '2', 
          'b1' =&gt; '8',
          'c1' =&gt; '11',
          'a2' =&gt; '9', 
          'b2' =&gt; '14',
          'c2' =&gt; '1',
          'a3' =&gt; '16', 
          'b3' =&gt; '15',
          'c3' =&gt; '23'
      );
  }
  </code></pre>
  
  <p>I suppose I could assign them as session data, but didn't think that would be the best move. Not really sure as I'm brand new to Codeigniter. In just a normal PHP project, I probably would just run an <code>include()</code> to the function.</p>
  
  <p>My question is, what is the best way to make the tiles' id and text available through multiple function calls without having to check and assign the array in each function?</p>