There is dynamic array that we received from database . It has some null value.
So I want to put empty string instead of null in value
I know, I can check with isset function. But it is dynamic array so it is difficult to find out number of key value pairs.
$hoteldetails = get_hotel_detail($hotel_id);
$response=json_encode($HotelDetail);
get Hotel details fetching from database. It may have some null value Ex- Latitude or longitude can have null. When I encode json_encode it display null.
I also tried array_filter but it is removing null value element. I do not want to remove key value element.