javascript数组转换为php数组? [英] javascript array converted to a php array?
本文介绍了javascript数组转换为php数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将javascript数组转换为php数组?
How can I convert a javascript array to a php array??
我有一个javascript数组,我想将值放入php数组$ b $请帮帮我?
I have a javascript array which I want to put the values into a php array please help me?
我将如何做到这一点?
推荐答案
你会通常使用 JSON.stringify $ c将数组转换为JSON字符串$ c>
,然后向服务器发出AJAX请求,接收字符串参数并 json_decode
它将返回PHP端的数组。
You would typically convert the array to a JSON string with JSON.stringify
, then make an AJAX request to the server, receive the string parameter and json_decode
it to get back an array in the PHP side.
这篇关于javascript数组转换为php数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文