Passing an array using an HTML form hidden element

前端 未结 8 2026
再見小時候
再見小時候 2020-11-27 12:40

I am trying to post an array in a hidden field and want to retrieve that array after submitting a form in PHP.

$postvalue = array(\"a\", \"b\", \"c\");


        
8条回答
  •  心在旅途
    2020-11-27 13:28

    It's better to encode first to a JSON string and then encode with Base64, for example, on the server side in reverse order: use first the base64_decode and then json_decode functions. So you will restore your PHP array.

提交回复
热议问题