code:
<?php
if(!isset($candidate_id))
{
header("location:".base_url()."login");
}
$this->db->select('event,event_title,description,s_date');
$this->db->from('event');
$this->db->where('candidate_id',$cid);
$this->db->order_by('s_date','desc');
$query = $this->db->get();
if($query->num_rows() > 0)
{
$result = $query->result_array();
$record = array();
foreach($result as $row)
{
$record[] = $row;
}
echo json_encode($record,JSON_NUMERIC_CHECK);
}
else
{
$this->session->set_flashdata('no_event',"<p>No event Added</p>");
}
?>
current output:
[{"event":"2019-03-06","event_title":"meeting","description":"meeting with xyz","s_date":"2019-03-04"}]
expected output:
[{event:"2019-03-06",event_title:"meeting",description:"meeting with xyz",s_date:"2019-03-04"}]
I am creating a simple JSON API using json_encode() function. Now, API I created successfully but the output is unexpected as I mention above. Now, What I actually want I also mention above. So, How can get I expected output? Please help me.
Thank You