how to pass array through hidden field

后端 未结 7 2025
醉梦人生
醉梦人生 2020-12-05 00:59

here my code

$order[$j][0]=\"Euclidean Geomethiyil Kodpagugal\";
$order[$j][1]=$q16;
$j++;

hidden field-



        
7条回答
  •  粉色の甜心
    2020-12-05 01:50

    Try json_encode:

    
    
    
    

    and for get it back, json_decode:

    print(json_decode($_POST['hdnOrder']));
    

    The bonus of this solution is that you will able to manipulate your array at client side easily with JavaScript.

    But why do you want to do that ?

    If it is not for manipulate your data at client side, you create an an unnecessary round trip of your data, that you can easily keep at server side with PHP sessions.

提交回复
热议问题