$query = $this->getpluginlist (); Query statement return value
$ret _plugin_ls = Array ();
foreach ($query->result () as $row) {//Object storage
Array_push ($ret _plugin_ls, $row);
}
Echo Json_encode ($ret _plugin_ls);
The json_encode data stored as objects (the data source above) is as follows:
$json = ' [{' id ': ' 1 ', ' plugin_name ': ' \u4e2a\u63a8 ', ' plugin_describe ': ' \u4e2a\u63a8\u63cf\u8ff0 ', ' Plugin_provider ': "\u897f\u6865", "plugin_version": "1.0", "plugin_upload_date": "2013-08-12 10:52:26", "Plugin_detail": "0", "plugin_ Expired ":" 0 "},{" id ":" 2 "," Plugin_name ":" 213231 "," Plugin_describe ":" 12123132 "," Plugin_provider ":" 2123321213 "," Plugin_version ":" 2.0 "," Plugin_upload_date ":" 2013-08-11 15:20:55 "," Plugin_detail ":" 0 "," plugin_expired ":" 0 "}] ';
To convert an array:
$arrdata = Json_decode ($json);
foreach ($allplugins as $row)
{
Echo $row->id;
Echo $row->plugin_name;
}
Print:
1
A push
2
213231
Reply to discussion (solution)
What does the landlord want to say ...
I Caishuxueqian please understand.
1, the data transmitted in JSON format, accept the end to convert (Json_decode);
2, the object format to store the send, the receiving end can only be displayed in the object format output.
What does the landlord want to say ...
He's tuition, not asking for doubts.