【发布时间】:2021-02-27 19:43:28
【问题描述】:
大家好,我想问一下如何使用 Json_Encode 对文本进行输出 这是我的代码
型号
function count_topup($ID)
{
$this->db->select_sum("Jumlah");
$this->db->from('topup');
$this->db->where('id_user',$ID);
$query= $this->db->get();
return $query->result_array();
}
控制器
$data['Count'] = $this->user_model->count_topup($ID);
查看
<?php echo json_encode($Count);?>
它会给出输出 [{"Jumlah":"150000"}]
如何只显示150000?感谢您的帮助
【问题讨论】:
-
现在试试我的更新视图。
标签: php json codeigniter-4