且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用GET将JavaScript数组发送到PHP脚本的***方法是什么?

更新时间:2023-11-28 22:46:52

json_decode()在这里可以为您服务.

json_decode() should serve you well here.

如果仅将包含javascript对象的JSON表示形式的字符串附加到HTTP请求,则可以在PHP中对其进行json_decode()并准备好使用PHP对象.

If you simply append a string containing the JSON representation of your javascript object to your HTTP request, you can json_decode() it in PHP and have a PHP object ready to go.

我应该提到此页面具有指向Javascript JSON字符串的链接,它将您的JS对象转换为必要的JSON.

I should mention that this page has a link to a Javascript JSON stringifier, which will convert your JS objects into the necessary JSON.