我从 json 提供服务,但在 json 中显示 url 时遇到问题,这个 url http://git.drieanto.net/LagiDimanaAPI/index.php/user/get_following/1我尝试从数据库中显示 url 但在 json show 中显示"avatar":"http:\/\/git.drieanto.net\/LagiDimanaAPI\/assets\/image\/avatar\/edwin.png"
。
如何显示这样的普通网址http://git.drieanto.net/LagiDimanaAPI/assets/image/avatar/edwin.png
我用codeigniter这个代码
function get_following($id_follower) {
if ($this->muser->cek_following($id_follower) == TRUE) {
$query = $this->muser->get_list_id($id_follower);
$feedback["following"] = array();
foreach ($query->result() as $row) {
$query_list_user = $this->muser->get_all_name_user_from_id($row->id_user);
if ($query_list_user->num_rows() > 0) {
$row_ = $query_list_user->row();
$query_status = $this->muser->get_status($row_->id_user);
$query_status->num_rows();
$row2 = $query_status->row();
$response['status'] = $row2->status;
$response['regid'] = $row_->regid;
$response['id_user'] = $row_->id_user;
$response['email'] = $row_->email;
$response['nama'] = $row_->nama;
$response['jenis_kelamin'] = $row_->jenis_kelamin;
$response['tanggal_lahir'] = $row_->tanggal_lahir;
$response['instansi'] = $row_->instansi;
$response['jabatan'] = $row_->jabatan;
$response['avatar'] = $row_->avatar;
$feedback['success'] = 1;
} else {
$feedback['success'] = 0;
}
array_push($feedback["following"], $response);
}
$feedback['success'] = 1;
echo json_encode($feedback);
} else {
$feedback['success'] = 0;
echo json_encode($feedback);
}
}
谢谢