Today, a blogger encountered such a problem, that is, how to directly write array parameters in the browser URL address bar for transmission. I asked several colleagues around me, but no successful writing method was found. I started to wonder if I could write an array directly in the address bar for transfer. I started searching on Google and Baidu, but also found no useful information.
Perhaps, everyone rarely encounters such a situation.
In this way, I began to slowly try to write, and tried all the methods I was familiar with, but the transmission was still wrong. Finally, I accidentally copied one more parameter, clicked Enter, and the transfer was successful, and it was still an array result. Full of achievements in an instant, even though it is just a simple small application.
Hereby, I would like to write a post to share with all blogger friends! Here is how to directly write array parameters in the URL address bar for transfer:
[php] view plain copy
That is, repeat your array variable multiple times with different variable values!
//URL address directly passes 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
The above is the detailed content of An example of writing array parameters in the URL address bar for transmission. For more information, please follow other related articles on the PHP Chinese website!