1.if($value['five_work_info']){ 2. $five_work_info = json_decode($value['five_work_info'],true); 3. $_POST['CHIN']['work']['five_work_info'] = array(); 4. $_POST['CHIN']['work']['five_work_info']['0']['company_name'] = $five_work_info['0']['name']; 5. $_POST['CHIN']['work']['five_work_info']['0']['company_address'] = $five_work_info['0']['address']; 6. }
tp报错 Cannot use string offset as an array 在line 4 ; 之后加了第三行的定义数组 = array()后解决
这个问题是因为PHP5.X对String和数组的规定严格了
$far='boo';
$far[1][]='boo';
运行这段脚本就会产生这样的错误。改正也非常简单,只要加一句:
$far='boo';
$far=array();
$far[1][]='boo';
$far='boo';
$far[1][]='boo';
运行这段脚本就会产生这样的错误。改正也非常简单,只要加一句:
$far='boo';
$far=array();
$far[1][]='boo';