how to convert javascript array to php array

前端 未结 4 1576
轮回少年
轮回少年 2021-01-07 09:04

here is the code to convert javascript array to php array..... this is done with cookies...

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie         


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-07 09:45

    You can use JSON to do this. On the JavaScript-side, just use JSON.stringify(theArray); to create a JSON-representation of that array. In PHP you can use json_decode(theString, true); to get the array Links: http://php.net/manual/function.json-decode.php http://en.wikipedia.org/wiki/JSON

提交回复
热议问题