当前位置:Gxlcms > PHP教程 > php入门4解析json对象

php入门4解析json对象

时间:2021-07-01 10:21:17 帮助过:15人阅读

functionlogging()
    {var  x = new XMLHttpRequest();

                x.onreadystatechange =function()
                {if(x.readyState == 4) {

                        if(x.status == 200) {
                            console.log("The server replied with: " + x.responseText);
                            txt.text = x.responseText;

                        }


                    }
                };
                var xxx = newObject;
                xxx.id=289672082;
                xxx.pwd = '12345';
                var pcode=  JSON.stringify(xxx);
                x.open("GET","http://localhost/mycode/Test/index.php?code="+pcode);
                x.send(null);
    }

解析

$pcode = $_GET['code']; 
$obj = json_decode($pcode);
echo$obj->id . "," . $obj->pwd;

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了 php入门4 解析json对象,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • 人气教程排行