title: Declare global array in codeigniter to access between different functions
body: <p>I want to declare a global variable in my model and will use it accordingly.<br>
  syntax below is just example how I want to use it, may not be proper syntax. But I want to know proper syntax for this to implement.</p>
  
  <pre><code>global $stddata
  </code></pre>
  
  <p>call to 1st function via ajax: </p>
  
  <p>add a array of data to this global variable.</p>
  
  <pre><code>global $stddata = array(1=&gt;"a",2=&gt;"b");
  </code></pre>
  
  <p>after user triggers some event call to 2nd function via ajax:</p>
  
  <p>Access the array stored in global variable above.</p>
  
  <pre><code>echo $stddata
  </code></pre>