I have a form like this :
<input type='text' name='category[]' value='firstcategory'>
<input type='text' name='category[]' value='secondcategory'>
and a validation rule like this
$this->form_validation->set_rules('category[]', 'Category Name', 'checkcategory');
how can I get the values firstcategory
and secondcategory
in my checkcategory
callback?
After I try print_r($_POST)
it showed me something like :
Array ( [category] => Array ( [0] => 'firstcategory' [1] => 'secondcategory' ) )
So in order to achieve what I want, I've tried something like this on my checkcategory
callback :
$neddle = array('firstcategory' => $str['category'][0], 'secondcategory' => $str['category'][1]);
But it didn't work.