Today, bloggers encounter such a problem, is how to directly write array parameters in the browser URL address bar to pass, asked several colleagues around, have not found a successful writing method. You start to wonder if it is possible to write an array directly in the address bar for delivery. Started in Google, Baidu search query, also did not find useful information.
Perhaps it is rare for people to encounter such a situation.
In this way, I began to slowly try to write, I am familiar with a few ways to try it all over again, still pass the wrong. Finally in the unintentional case, accidentally copied more than one of the parameters, click Enter, unexpectedly passed successfully, or array results. Instant achievements, although just a simple small application.
Hereby, write a post to the general Bo friends to share! Here's how to write an array parameter directly in the URL address bar for delivery:
[PHP] View plain Copy
That is, you repeat the array variable multiple times, the variable value is different!
URL address directly passing array parameters
localhost/api/public/yanglao/index.php?service=user.postservicepayment&elder_id=17&user_id=1592& pay_points=1&pay_money=0&charge_ids[]=1&charge_ids[]=2