I am using codeigniter bonfire framework for creating a web. Everywhere where i m using echo json encode i am getting error in error logs like :-
ERROR - 2015-07-06 17:38:49 --> Severity: Warning --> Cannot modify header information - headers already sent by (output started at... )
Why this error generate in error logs file. Its a example code where the warning generating.
public function get_filter()
{
if(!empty($_GET))
{
$search = $_GET;
$restaurant = $this->discount_model->get_offer_restaurant_by_discount($_GET);
echo json_encode($restaurant);
}
else{
$restaurant = $this->discount_model->get_all_discount_restaurants();
echo json_encode($restaurant);
}
}
Here the error generated at echo json_encode($restaurant) line. How to stopped this error.