how to send array values through url in PHP?

前端 未结 7 1312
情话喂你
情话喂你 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:38

    If you are POST-ing data, then name your fields with PHP array-style syntax:

    
    
    
    

    If you want to pass the data in a GET request, you can separate the data and split it server side using explode:

    page.php?myData=A,B,C,D
    

    ...

    $myArray = explode(',', $_POST['myData']);
    

提交回复
热议问题