搜索

首页  >  问答  >  正文

php如何解析jquery serialize 提交后的数据

$data ="realname=lemon&numid=123"
怎样转换成
$data= array('realname'=>'lemon'
,numid=>'123',)

天蓬老师天蓬老师2869 天前457

全部回复(3)我来回复

  • 黄舟

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

    用ajax post到后台的数据直接为数组形式
    $.ajax({
    type: "POST",
    url: "some.php",
    data: "name=John&location=Boston",
    success: function(msg){

     alert( "Data Saved: " + msg );

    }
    });

    回复
    0
  • 巴扎黑

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

    不用转啊,直接接收就是啊

    回复
    0
  • 过去多啦不再A梦

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

    不用转,直接打印出来print_r($_POST),看到的就是这个格式的数据了

    回复
    0
  • 取消回复