title: codeigniter form validation error
body: <p>In my controller i am setting rules like this </p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_rules("contact_name[]","Contact Name","required|max_length[25]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_title[]","Contact Title","required|max_length[25]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_main[]","Contact Main Number","required|max_length[45]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_direct[]","Contact Direct Number","required|max_length[45]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_cell[]","Contact Cell Number","required|max_length[45]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_primary","Primary","required|max_length[45]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_fax[]","Fax","required|max_length[105]|xss_clean|htmlspecialchars");
          $this-&gt;form_validation-&gt;set_rules("contact_email[]","Contact Email ID","required|max_length[105]|xss_clean|htmlspecialchars");
  </code></pre>
  
  <p>and the html is = ></p>
  
  <pre><code> &lt;input type="text" name="contact_name[]" value="Dileep" class="t_contact_name"&gt;
       //and some others too as name as array
  </code></pre>
  
  <p>after posting i will get something like this </p>
  
  <pre><code>array
    'company' =&gt; string 'Sccc' (length=4)
    'name' =&gt; string 'Ajay ccc' (length=8)
    'address' =&gt; string 'ccsd' (length=4)
    'city' =&gt; string 'City name' (length=9)
    'state' =&gt; string '20' (length=2)
    'zip' =&gt; string '665996555' (length=9)
    'country' =&gt; string '6' (length=1)
    'category' =&gt; string 'popular' (length=7)
    'credit' =&gt; string '2566' (length=4)
    'website' =&gt; string 'ccc' (length=3)
    'primary_flag' =&gt; string '1' (length=1)
    'discount' =&gt; string '0' (length=1)
    'payment_terms' =&gt; string '6' (length=1)
    'customerid' =&gt; string 'ccc' (length=3)
    'notes' =&gt; string 'cc' (length=2)
    'contact_name' =&gt; 
      array
        0 =&gt; string 'Dileep' (length=6)
        1 =&gt; string 'Dileep' (length=6)
        2 =&gt; string 'Dileep' (length=6)
        3 =&gt; string 'Dileep' (length=6)
        4 =&gt; string 'Dileep' (length=6)
        5 =&gt; string 'Dileep' (length=6)
        6 =&gt; string 'Dileep' (length=6)
        7 =&gt; string 'Dileep' (length=6)
        8 =&gt; string 'Dileep' (length=6)
    'contact_primary' =&gt; 
      array
        0 =&gt; string 'true' (length=4)
        1 =&gt; string 'false' (length=5)
        2 =&gt; string 'false' (length=5)
        3 =&gt; string 'false' (length=5)
        4 =&gt; string 'false' (length=5)
        5 =&gt; string 'false' (length=5)
        6 =&gt; string 'false' (length=5)
        7 =&gt; string 'false' (length=5)
        8 =&gt; string 'false' (length=5)
    'contact_title' =&gt; 
      array
        0 =&gt; string 'Curio' (length=5)
        1 =&gt; string 'Curio' (length=5)
        2 =&gt; string 'Curio' (length=5)
        3 =&gt; string 'Curio' (length=5)
        4 =&gt; string 'Curio' (length=5)
        5 =&gt; string 'Curio' (length=5)
        6 =&gt; string 'Curio' (length=5)
        7 =&gt; string 'Curio' (length=5)
        8 =&gt; string 'Curio' (length=5)
    'contact_main' =&gt; 
      array
        0 =&gt; string '66558-66554-6665' (length=16)
        1 =&gt; string '66558-66554-6665' (length=16)
        2 =&gt; string '66558-66554-6665' (length=16)
        3 =&gt; string '66558-66554-6665' (length=16)
        4 =&gt; string '66558-66554-6665' (length=16)
        5 =&gt; string '66558-66554-6665' (length=16)
        6 =&gt; string '66558-66554-6665' (length=16)
        7 =&gt; string '66558-66554-6665' (length=16)
        8 =&gt; string '66558-66554-6665' (length=16)
    'contact_direct' =&gt; 
      array
        0 =&gt; string '5555-666-555' (length=12)
        1 =&gt; string '5555-666-555' (length=12)
        2 =&gt; string '5555-666-555' (length=12)
        3 =&gt; string '5555-666-555' (length=12)
        4 =&gt; string '5555-666-555' (length=12)
        5 =&gt; string '5555-666-555' (length=12)
        6 =&gt; string '5555-666-555' (length=12)
        7 =&gt; string '5555-666-555' (length=12)
        8 =&gt; string '5555-666-555' (length=12)
    'contact_cell' =&gt; 
      array
        0 =&gt; string '555-6654-555' (length=12)
        1 =&gt; string '555-6654-555' (length=12)
        2 =&gt; string '555-6654-555' (length=12)
        3 =&gt; string '555-6654-555' (length=12)
        4 =&gt; string '555-6654-555' (length=12)
        5 =&gt; string '555-6654-555' (length=12)
        6 =&gt; string '555-6654-555' (length=12)
        7 =&gt; string '555-6654-555' (length=12)
        8 =&gt; string '555-6654-555' (length=12)
    'contact_fax' =&gt; 
      array
        0 =&gt; string '996-5565-656' (length=12)
        1 =&gt; string '996-5565-656' (length=12)
        2 =&gt; string '996-5565-656' (length=12)
        3 =&gt; string '996-5565-656' (length=12)
        4 =&gt; string '996-5565-656' (length=12)
        5 =&gt; string '996-5565-656' (length=12)
        6 =&gt; string '996-5565-656' (length=12)
        7 =&gt; string '996-5565-656' (length=12)
        8 =&gt; string '996-5565-656' (length=12)
    'contact_email' =&gt; 
      array
        0 =&gt; string 'mailer@mail.com' (length=20)
        1 =&gt; string 'mailer@mail.com' (length=20)
        2 =&gt; string 'mailer@mail.com' (length=20)
        3 =&gt; string 'mailer@mail.com' (length=20)
        4 =&gt; string 'mailer@mail.com' (length=20)
        5 =&gt; string 'mailer@mail.com' (length=20)
        6 =&gt; string 'mailer@mail.com' (length=20)
        7 =&gt; string 'mailer@mail.com' (length=20)
        8 =&gt; string 'mailer@mail.com' (length=20)
    'userfile2' =&gt; string '' (length=0)
    'contact_log' =&gt; 
      array
        0 =&gt; string 'Waiting for the release....' (length=27)
    'contact_time' =&gt; 
      array
        0 =&gt; string '6/30/12' (length=7)
    'contact_duedate' =&gt; 
      array
        0 =&gt; string '12/01/2012' (length=10)
  </code></pre>
  
  <p>But when i do run the form validation i am getting some errors</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: mb_strlen() expects parameter 1 to be string, array given
  
  Filename: libraries/Form_validation.php
  
  Line Number: 1003
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: htmlspecialchars() expects parameter 1 to be string, array given
  
  Filename: libraries/Form_validation.php
  
  Line Number: 619
  </code></pre>
  
  <p>What is the real problem or what am I doing wrong?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Please check that the input names are array,there are more than same type values.So i need to use field names as array.</p>
  
  <p>as per the codeigniter Form validation i can validate the form with containng field names as array.</p>