title: Undefined offset: 2 in codeigniter
body: <p>Here is my controller function as far as i can see there is no error but it still showing me this message .what does it mean .</p>
  
  <pre>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
       class User extends CI_Controller {
  
      public function __construct()
      {
              parent::__construct();
              // Your own constructor code
  
              //$this-&gt;load-&gt;model('user_model');
      }
  
      public function index()
      {
          $this-&gt;load-&gt;view('user/signup');
      }
      public function registration()
      {
  
          if($this-&gt;input-&gt;post())
          {
              $fullname=$this-&gt;input-&gt;post('fullname');
              $fullnameSplit= explode(" ", $fullname);
  
              $reg_data = array(
                  'membershipid'=&gt;"Ls-".rand(),
                  'role'=&gt;1,
                  'firstname'=&gt;$fullnameSplit[0],
                  'middlename'=&gt;$fullnameSplit[1],
                  'lastname'=&gt;$fullnameSplit[2],
                  'Company_name'=&gt;$this-&gt;input-&gt;post('companyname'),
                  'email'=&gt;$this-&gt;input-&gt;post('email'),
                  'password'=&gt;sha1($this-&gt;input-&gt;post('password')),
  
              );
              print_r($reg_data);
              //$this-&gt;user_model-&gt;register_user($reg_data);
              //redirect('user/login');
  
              //echo '&lt;pre&gt;'; print_r($reg_data); die;
  
  
          }else 
          {
  
              //$data['current_page'] = 'Register';
              //$this-&gt;load-&gt;view('registration',$data);
          }
      }
  
  
  }
  </code></pre>
  
  </pre>
  
  <p>This error is showing .</p>
  
  <pre>
  
  A PHP Error was encountered
  
  Severity: Notice
  
  Message: Undefined offset: 2
  
  Filename: controllers/User.php
  
  Line Number: 35
  
  Backtrace:
  
  File: /var/www/overtribe.com/public_html/listspread/application/controllers/User.php
  Line: 35
  Function: _error_handler
  
  File: /var/www/overtribe.com/public_html/listspread/index.php
  Line: 293
  Function: require_once
  
  </pre>