0
![Stack Overflow](http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png)
Okay, try this. Afterwards you have an array with each key once and an array of all ids but every id maximum once. You could implode() the ids array with # if you want a string again.
<?php
$data = array(
array('name'=>'this', 'ids'=>'x'),
array('name'=>'this', 'ids'=>'x#y'),
array(...