我想归还col1_2,col2_2,col3_2,col4_2,col1_3,col2_3,col3_3,col4_3,col1_4_4_etc,以便我能将它用于其他职能。
So I made like this.
function _fields($keynum){
for ($r=2; $r<$keynum; $r++){
for($c=1; $c<5; $c++){
$colname="col".$c."_".$r;
return $colname.",";
}
}
}
function create(){
if ($this->input->post( keynum )){
$keynum=$this->input->post( keynum );
$output = $this->_fields($keynum);
$output=explode(",", $output);
$data[ output ]=$output;
...
...
However function _fields() returns only col1_2. If I echo out instead of return $colname.","; It echo outs col1_2,col2_2,col3_2,col4_2. But this can t be used in function create().
I will be appreciate your input. Thanks in advance.