【发布时间】:2014-02-16 10:31:09
【问题描述】:
我是使用 PHP 从 json_encode 创建的 JSON 数组。我把我的数组给了 json_encode 。它很好地创建了 JSON 数组。我将这个 JSON 数组提供给我的 android 应用程序。当我要在 android 上阅读这个 url 时,它会在异常错误之后返回。
Error parsing data org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONObject
但是当我要在 android 上创建 jason 对象时,添加以下行
jObj=new JSONObject(json.substring(json.indexOf("{"), json.lastIndexOf("}") + 1));
它运行良好。
但我不想需要第二种类型的解决方案。当我将 json_encode 放在 php 上时,我需要 php 解决方案。
而且在 IOS 上,JSON 返回 NULL 值。我如何在 IOS 和 Android 中修复
提前感谢
【问题讨论】:
标签: php android ios arrays json