如何在php中操作表

Please I have the fowlloing code :

foreach($global as $item) 
    {   
        $item_array[] = array
                        (
                            '0'  => value($this->elem[0], $item),
                            '1'   => value($this->elem[1], $item),
                            '2' => value($this->elem[2], $item),
                            '3'  => value($this->elem[3], $item),
                            '4' => value($this->elem[4], $item)
                        );
    }

And I want to simplify it as the folloing :

foreach($global as $item) 
    {       
        $i=0;
        array_push($item_array[], value($this->elem[$i], $item) );
        $i++; 
             }

This code gives me an arror because of "$item_array[]" which is necessary for my script. What can I do ?

Note : I'm very newbie to PHP. Thanks.

You need to delete [] and put the $i=0 outside the for loop.