第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在php中提取json

在php中提取json

PHP
冉冉說(shuō) 2021-04-09 14:15:55
有我的ajax代碼//If chkArray is not empty show the <div> and create the list        if(chkArray.length !== 0) {            $.ajax({                method: 'POST',                url : 'http://localhost/shop/ext/ajax/products_compare/test.php',//                data : JSON.stringify({product_id: chkArray})                data: {product_id: JSON.stringify(chkArray)},            });        }我得到這樣的結(jié)果:array(1) {  ["{"product_id":"]=>  array(1) {    [""10","9""]=>    string(0) ""  }}如何在php中提取此代碼?
查看完整描述

1 回答

?
汪汪一只貓

TA貢獻(xiàn)1898條經(jīng)驗(yàn) 獲得超8個(gè)贊

無(wú)需使用JSON.stringify,只需傳遞原始值數(shù)組即可:


$.ajax({

    method: 'POST',

    url : 'http://localhost/shop/ext/ajax/products_compare/test.php',

    data: {product_id: chkArray},

});

在服務(wù)器端,您將擁有$_POST['product_id']帶有值的數(shù)組。


查看完整回答
反對(duì) 回復(fù) 2021-04-23
  • 1 回答
  • 0 關(guān)注
  • 168 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)