How can I remove duplicate arrays? it's different from array unique because that is removing duplicate values inside array..
i get an array list like this
1. array('item' => 6, 'quantity' => 1, 'price' => 120)
2. array('item' => 6, 'quantity' => 1, 'price' => 120)
3. array('item' => 6, 'quantity' => 1, 'price' => 120)
4. array('item' => 22, 'quantity' => 8, 'price' => 30)
5. array('item' => 22, 'quantity' => 8, 'price' => 30)
how do i make like this while keeping the values?
3. array('item' => 6, 'quantity' => 1, 'price' => 120)
4. array('item' => 22, 'quantity' => 8, 'price' => 30)
code
$get = file_get_contents('URL');
$json = json_decode($get, true);
$results = print_r($json);
file_put_contents('file.json', print_r($json, true), FILE_APPEND);