To JSON and json_decode in PHP and JavaScript

后端 未结 3 1389
别跟我提以往
别跟我提以往 2021-01-21 00:33

I\'m trying to pass a JavaScript object to a PHP script through jquery.ajax(), basically:

var bigArray = new Object();
//Dode
//Start loop
bigArray[         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-21 01:11

    Isn't it clear enough? json_decode() expects parameter one to be string, not array. But $_POST and $_GET are always arrays. You can pass a member of this array to json_decode().

    To see an array's contents, use this snippet:

    echo "
    ";
    print_r($_GET);
    echo "
    ";

提交回复
热议问题