title: CodeIgniter PHP - How to randomly select a language class message?
body: <p>The idea here is to have a series of tips in application/language/english/tips_lang.php</p>
  
  <pre><code>$lang['tip1'] = 'Water your plants';
  $lang['tip2'] = 'Aerate your soil';
  $lang['tip3'] = 'Use ventilation';
  $lang['tip4'] = 'Fertilizers are good';
  
  etc...
  </code></pre>
  
  <p>In my controller I would like to have something like this pseudo-code</p>
  
  <pre><code>$input = $this-&gt;lang-&gt;line('tip_array');
  
  $tip = array_rand($input, 1);
  </code></pre>
  
  <p>Anyone know if this is possible?</p>
  
  <p>Thanks for giving a hand!</p>
  
  <p>UPDATE controller</p>
  
  <pre><code>        //Random Tip
          $array = explode('|', $this-&gt;lang-&gt;line('tips'));
          $tips = array_rand($array, 1);
          $this-&gt;template-&gt;write('tips', $tips);
  </code></pre>