how to send array values through url in PHP?

前端 未结 7 1294
情话喂你
情话喂你 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条回答
  • 2020-12-16 08:41

    You can either serialize() it or send it as ?a[]=1&a[]=val2&someOtherArg=val. This will give a $_GET array like:

    array(
        'a' => array(
            0 => '1',
            1 => 'val2',
        ),
        'someOtherArg' => 'val'
    )
    

    Do note, however, that you should probably keep your entire query below ~2k characters. (more)

    0 讨论(0)
提交回复
热议问题