我有問題函數在控制器,形成更象波紋管代碼:消息:取消定義偏移量:10從笨
我發送數據IDDATA用Ajax到控制器 「Update_Kebutuhan_ke_Terpasang」
http://localhost/gishubkbm/Terpasang/Update_Kebutuhan_ke_Terpasang?iddata=[1,2,16,15,17,3,14,5,9,11]
代碼控制器像波紋管:
$iddata=array();
$iddata=array($_GET['iddata']); //value [1,2,16,15,17,3,14,5,9,11]
$a=explode(",", $iddata[0]); //explode value iddata
$b=preg_replace('/[^A-Za-z0-9\-]/', '', $a);
$jumlahdata=count($b);
for($i=0;$i<=$jumlahdata;$i++)
{
$c=$b[$i]; // **problem here with message undefined offset : 10**
$data=array('id_perjal'=>$c);
$this->M_perjal_terpasang->save($data);
}
echo json_encode(array("status" => TRUE));
但所有專業人員es運行,數據可以在數據庫上輸入。