doujiepin5547 2015-07-18 10:30
浏览 245
已采纳

PHP序列化所有POST数据

I want to serialize all POST data from HTML form with PHP. I have tried with this code: serialize($_POST); but as result I get serialized INPUT Names and Values together, I want to get serialized only Values of INPUT.

  • 写回答

1条回答 默认 最新

  • douqi3064 2015-07-18 10:38
    关注

    if you need to serialize only array values - use array_values function. After using this function you will have your array values, but keys will be numeric:

    serialize(array_values($_POST))
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?