Q:

Can codeigniter receive post array?

I am trying to receive a post array send from the view page by using $this->input->post(). However, it seems like that CI is not able to do it. Any thoughts?
controller
public function pub()
    {
    // the postArray is an array: $postArray['t1']=test1, $postArray['t2']=test2 
    $go=$this->input->post('postArray');    
    foreach ($go as $test){

    echo $test['t1'];  //show nothing
    echo $test['t2'];  //show nothing

    }

//the following code would work if I sent the $postArray as a string variable

 public function pub()
    {
    // the postArray is an string variable $postArray='test1'
    $go=$this->input->post('postArray');    

    echo $go; //show test1

        }

Thanks for help. 
UPDATE:
the following is the Jquery code in my view page 
   //postArray is an array
     $.post('<?=base_url()?>/project_detail/pub', {'postArray':postArray},function(go)
        {
            alert(go);
        })

A:

Have you checked your HTML? You should include the [] synthesis into the name attribute to create an array, for example
<input type="text" value="something..." name="postArray[]" />
<input type="text" value="something..." name="postArray[]" />

Output of print_r($this->input->post()):
Array (

   [0] => something...
   [1] => something...
)

If you want to include name keys instead of indexed array, you can use this method:
<input type="text" value="something..." name="postArray[t1]" />
<input type="text" value="something..." name="postArray[t2]" />

Output of print_r($this->input->post()):
Array (

   [t1] => something...
   [t2] => something...
)

