search

Home  >  Q&A  >  body text

How to parse data submitted by jquery serialize in php

$data ="realname=lemon&numid=123"
How to convert to
$data= array('realname'=>'lemon'
,numid=>'123',)< /p>

天蓬老师天蓬老师2836 days ago438

reply all(3)I'll reply

  • 黄舟

    黄舟2017-05-16 13:03:19

    Use ajax to post data to the background directly in the form of array
    $.ajax({
    type: "POST",
    url: "some.php",
    data: "name=John&location=Boston",
    success: function( msg){

    1

    <code> alert( "Data Saved: " + msg );</code>

    }
    });

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 13:03:19

    No need to transfer, just receive it directly

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:03:19

    No need to convert, just print it outprint_r($_POST). What you see is the data in this format

    reply
    0
  • Cancelreply