how to send array values through url in PHP?

前端 未结 7 1310
情话喂你
情话喂你 2020-12-16 07:56

how to send array through url in PHP?

I have an array of product ids i want to use these id through url because this is the osCommerce needs it in which i am working

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 08:40

    If you already have the product IDs in an array, then you can use the http_build_query() function, which will encode the array like thus:

    http://www.example.com/?pid[]=1&pid[]=2&pid[]=3 ...

    Hope that helps.

提交回复
热议问题