【发布时间】:2014-05-06 08:40:14
【问题描述】:
我正在开发一个 android 应用程序,我正在使用 php/doctrine 从数据库中检索数据。我把所说的数据放在一个 json 对象中。
问题是我不知道如何在 android 上显示它。 这是php代码:
function getTransaction($id) {
$transaction = $this->getDoctrine()
->getRepository('nameBundle:Transaction')
->find($id);
if(!$transaction) {
throw $this->createNotFoundException('No transaction found'.$id);
}
$array = $transaction->toArray();
$json = json_encode($array);
}
【问题讨论】:
-
检查我已经回答[这里][1] 你可以通过这个例子来实现。 [1]:stackoverflow.com/a/22558535/3360307
-
基本上这个教程就是你想要的。一键省你androidhive.info/2012/05/how-to-connect-android-with-php-mysql
标签: php android json api doctrine