Php 如何在Laravel 5.2中获得多个URL值
如何在Laravel 5.2中获得多个参数值 例如:Php 如何在Laravel 5.2中获得多个URL值,php,laravel-5,Php,Laravel 5,如何在Laravel 5.2中获得多个参数值 例如: http://localhost:8000/print?id=1&id=3 如何在数组中获取ids的值,比如[1,2]?您可以使用url中的[]发送数据,如下所示: http://localhost:8000/print?id[]=1&id[]=3 然后,您可以通过以下方式在控制器中获取: $request->get('id') // returns [1,3] 您可以使用url中的[]发送数据,如下所示: htt
http://localhost:8000/print?id=1&id=3
如何在数组中获取
id
s的值,比如[1,2]
?您可以使用url中的[]
发送数据,如下所示:
http://localhost:8000/print?id[]=1&id[]=3
然后,您可以通过以下方式在控制器中获取:
$request->get('id') // returns [1,3]
您可以使用url中的
[]
发送数据,如下所示:
http://localhost:8000/print?id[]=1&id[]=3
然后,您可以通过以下方式在控制器中获取:
$request->get('id') // returns [1,3]
您到底想做什么?如果您想获取id的值,请使用array,
http://localhost:8000/print?id[]=1&id[]=3
并检查具体要做什么?如果要获取id的值,请使用数组,http://localhost:8000/print?id[]=1&id[]=3
并检查