php输出的数据
var_dump($_POST);
array(16) { ["title"]=> string(35) "你好吗" ["company"]=> string(6) "你好" ["headmaster"]=> string(1) "3" ["Dheadmaster"]=> string(1) "3" ["years"]=> string(4) "2022" ["classroomtype"]=> string(1) "5" ["kzcd"]=> string(3) "127" ["select"]=> string(14) "30,31,32,33,34" ["rank"]=> string(0) "" ["stime"]=> string(0) "" ["etime"]=> string(0) "" ["scorestime"]=> string(0) "" ["scoreetime"]=> string(0) "" ["tabletimesel"]=> string(0) "" ["filestime"]=> string(0) "" ["fileetime"]=> string(0) "" }
JS
var d = {};
var t = $('form').serializeArray();
var data = $('form').serialize();
$.each(t, function() {
d[this.name] = this.value;
});
console.log(JSON.stringify(d));
var qwe = JSON.stringify(d);
$.ajax({
dataType: "json",
url: 'classroomupdate.php?t=update&cd=<?php echo $_GET['id']?>',
type:'post',
data:qwe,
{"title":"你好吗","company":"你好","headmaster":"3","Dheadmaster":"3","years":"2022","classroomtype":"5","kzcd":"127","select":"30,31,32,33,34","rank":"","stime":"","etime":"","scorestime":"","scoreetime":"","tabletimesel":"","filestime":"","fileetime":""}
PHP 怎样获取键对应的值?