这个错误是什么“非法字符串偏移'id'”?

时间:2017-01-28 22:04:19

标签: php json laravel laravel-5

我想获得json的值,例如

function notification(Request $request){
    $registers =$request->get('json');
    return $registers[0]["id"];
}

但我收到此错误:“”非法字符串偏移'id'“

调用此方法的帖子:

<input type="hidden" name="json[]" value="{{json_encode($item,JSON_UNESCAPED_UNICODE)}}">

,路线是:

$app->post('notification','AtlanticControllerChangePrice@notification');

并且项目有:

> {"id":"30264379-6648-f55e-6a67-588a440d7329","name":"Cambio
> Precio","lista":"OVG","oficina_ventas":"1100","lista_precios":"17","tipo_precio":"LISTA","nit":"32466669","producto":"304","material":"CHUCK
> FLAT - CERTIFIED ANGUS
> BEFF","unidad_medida":"KG","precio_actual":"46000","nuevo_precio":"49800","fecha_inicio":"2017-01-16","cod":"1000473","cliente":"","procesado":"0","idClient":"b6d23a02-ac53-c327-83e6-587e1177a94d","name_client":"POSADA
> DE POSADA INES LUCIA PATRICI"}

0 个答案:

没有答案