My PHP script is returning some array and I would like to remove duplicates in that array. Can you please tell me how? I dont want to remove duplicates from MySQL, just from PHP
Replace this:
$rows = (object) array('lista' => $rows); echo json_encode($rows);
With this:
$lista = array_map('unserialize', array_unique(array_map('serialize', $rows))); echo json_encode((object) array('lista' => $lista));