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

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

如何精確去掉變量后的雙引號(hào),不用正則

如何精確去掉變量后的雙引號(hào),不用正則

慕森卡 2018-07-02 00:00:15
去掉answer后面的一對(duì)雙引號(hào) 只保留"answer":{} 我該怎么做{        "hr_email":"4564",        "test_name":"dadsa",        "email":"dsad@qq.com",        "sex":"\u5973","host":"",        "checkcode":"aa458",        "answer":"{"A1":"0|1","A2":"1|5","A3":"1|4","A4":"1|4","A5":"1|4","A6":"1|3","A7":"1|4","A8":"1|5","A9":"1|3","A10":"1|4","A11":"1|4","A12":"1|2","A13":"1|4","A14":"1|2","A15":"1|3","A16":"1|4","A17":"1|4","A18":"1|3","A19":"1|4","A20":"1|5","A21":"1|2","A22":"1|3","A23":"1|3","A24":"1|5","A25":"1|3","A26":"1|3","A27":"1|4","A28":"1|3","A29":"1|2","A30":"1|3","A31":"1|3","A32":"1|3","A33":"1|5","A34":"1|3","A35":"1|3","A36":"1|3","A37":"1|4","A38":"1|4","A39":"1|2","A40":"1|4"}"}
查看完整描述

3 回答

?
慕斯709654

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

這是后臺(tái)給你數(shù)據(jù)格式給錯(cuò)了,校驗(yàn)都通不過(guò),你應(yīng)該讓后臺(tái)去解決這個(gè)問(wèn)題。

查看完整回答
反對(duì) 回復(fù) 2018-07-10
?
侃侃爾雅

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

單獨(dú)拿出"answer"后得到字符串
$str = "{"A1":"0|1","A2":"1|5","A3":"1|4","A4":"1|4","A5":"1|4","A6":"1|3","A7":"1|4","A8":"1|5","A9":"1|3","A10":"1|4","A11":"1|4","A12":"1|2","A13":"1|4","A14":"1|2","A15":"1|3","A16":"1|4","A17":"1|4","A18":"1|3","A19":"1|4","A20":"1|5","A21":"1|2","A22":"1|3","A23":"1|3","A24":"1|5","A25":"1|3","A26":"1|3","A27":"1|4","A28":"1|3","A29":"1|2","A30":"1|3","A31":"1|3","A32":"1|3","A33":"1|5","A34":"1|3","A35":"1|3","A36":"1|3","A37":"1|4","A38":"1|4","A39":"1|2","A40":"1|4"}"
然后使用 rtrim($str, '"'),ltrim($str, '"'),然后在整合,
不過(guò)就像樓上說(shuō),已經(jīng)是前臺(tái)傳過(guò)來(lái)有誤了,所以最好是還是前臺(tái)寫(xiě)好正確規(guī)范的json,在傳會(huì)比較好

查看完整回答
反對(duì) 回復(fù) 2018-07-10
?
慕容708150

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

你這是json嗎?多了一個(gè)'"',最后少了一個(gè)'}',JS的話(huà),查找位置str.indexOf('answer')后,然后截取兩段,在拼接一下試試。

查看完整回答
反對(duì) 回復(fù) 2018-07-10
  • 3 回答
  • 0 關(guān)注
  • 513 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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