this is my contoller
$pid = json_decode(file_get_contents('php://input'), true);
foreach ($pid as $key => $value) {
foreach ($value as $keys => $values) {
$c_res = $this->Model_master->get_sup($values);
echo json_encode($c_res, 200);
}
}
this is my model
$q = $this->db->select('contact_number')->from('shopxie_people')
->where("p_id = ".$value)
->get();
return $q->result_array();
this shows me result in html form but when i change it to json it gives me
SYntax error
also in postman content-type is showing as text/html;
why does it happen even after encoding in json in my code?
200injson_encode($c_res, 200)just remove it