PHP: file_get_contents('php://input') returning string for JSON message

前端 未结 7 1464
梦毁少年i
梦毁少年i 2020-12-19 04:26

I am trying to read in a JSON message in my PHP app and this is my php code:

$json = file_get_contents(\'php://input\');
$obj = json_decode($json, TRUE);
ech         


        
相关标签:
7条回答
  • 2020-12-19 04:53

    Try this https://stackoverflow.com/a/56801419/7378998

    It works for JSON or jquery post

    $.post(url, $('form').serialize());
    
    0 讨论(0)
提交回复
热议问题