I don't know whats the context of this and your question is vague, but anyway, I hope this is what you want to achieve. (and your variable naming is odd). In your example index zero and two are the same, and since they are multi-dimensional, you can flatten them in a way by using serialize
. Try this:
$json_data = array();
$json_data[]= array ('id'=>'1','brand'=>'chanel','name'=>'red');
$json_data[]= array ('id'=>'3','brand'=>'lacoste','name'=>'green');
$json_data[]= array ('id'=>'1','brand'=>'chanel','name'=>'red');
$json_data = array_map('serialize', $json_data);
$values = array_count_values($json_data);
echo '<pre>';
foreach($values as $array => $count) {
if($count > 1) {
$array = unserialize($array);
print_r($array);
}
}
Should output/print the ones that has duplicates:
Array
(
[id] => 1
[brand] => chanel
[name] => red
)