how to pass an array in GET in PHP?

后端 未结 12 982
萌比男神i
萌比男神i 2020-11-28 14:37
$idArray = array(1,2,3,4);

can I write this line in HTML?

12条回答
  •  猫巷女王i
    2020-11-28 14:55

    In the particular case you mentioned, I would implode the array to a string and then explode it when you post the form.

    $str = rawurlencode(implode(",",$idArray));
    
    
    

    and then on the post processing:

     $idArray = explode(",",rawurldecode($_POST['arr']));
    

提交回复
热议问题