01) 判断请求参数是否存在
判断参数在请求中是否存在 $request->has('name') $request->has(['name', 'email']) // 判断参数存在且参数值不为空 $request->filled('name')
{ "foo":"bar", "hello":"world", "da":"", "hebei":{ "shijiazhunag":"石家庄", "baoding":"保定" } } // print_r($request->path()); // print_r($request->method()); // print_r($request->json()->all()); // print_r($request->json("foo")); // print_r($request->input()); // print_r($request->has('eeee')); // print_r($request->json("hebei.shijiazhunag")); // print_r($request->input("hebei.shijiazhunag")); // print_r($request->only(['foo','hello',"fei"])); // print_r($request->only(['foo','hello',"shijiazhunag"])); // print_r($request->except(['foo'])); var_dump($request->has(['foo','hello'])); // var_dump($request->has(['foo','aaaa'])); // print_r($request->get("foo")); // print_r($request->post("foo")); var_dump($request->filled('da'));