Submitting JSON data via JQuery ajax.post to PHP

前端 未结 4 1372
慢半拍i
慢半拍i 2020-11-28 15:33

Im submitting Data to a php file via AJAX using POST. It worked fine with just submitting strings, but now I wanted to submit my JS Object with JSON and decode it on PHP sid

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 16:13

    Single quotes are not valid for php's json_encode, use the double quotes for both field names and values.

提交回复
热议问题