I'm using array_unique to remove the duplicate values but it returns an object format.
$event = array_unique($array_event);
output as
{"0":{"title":"new","description":"hai"},"4":null}
Excepted output:
[{"title":"new","description":"hai"},null}]
Can anyone help with this issue?
$event = array_values(array_unique($array_event));json_encodewhich it self those not produce the required output in this casejson_encode($event)