我有一個json看起來像這樣。從json中查找對象
{
"countrycode" :
[["11","","91","INDIA"," New Delhi"],
["112","Mahanagar Telephone Nigam Ltd (MTNL]","91","INDIA"," New Delhi"],
["113","Reliance Communications Ltd","91","INDIA"," New Delhi"],
["114","Bharti Airtel Ltd","91","INDIA"," New Delhi"],
["115","Sistema Shyam TeleServices Ltd (MTS]","91","INDIA"," New Delhi"],
["122","","91","INDIA"," Hapur Ghaziabad"],
["1222","Bharat Sanchar Nigam Ltd (BSNL]","91","INDIA"," Hapur Ghaziabad"],
["1223","Reliance Communications Ltd","91","INDIA"," Hapur Ghaziabad"]]
}
我想用我的價值找到第一行json的完美匹配記錄。我的價值可能是「1178920」或「1130123」或「1151593248」或「1223798」。
如果我的價值是1223798然後返回我:
["1223","Reliance Communications Ltd","91","INDIA"," Hapur Ghaziabad"]]
我不能找到一種方法。請幫幫我。
是你的json是否正確。因爲在你的json中只有第一個Array對象包含另一個數組檢查。 –
請發佈您嘗試過的代碼,並描述它做了什麼錯誤 – Feldur
@NiravDoctorwala我的json是正確的,請檢查http://jsonlint.com/進行驗證。 –