remove duplicate key value pairs in an array php code example Example: php remove duplicates from string $str = implode(',',array_unique(explode(',', $str)));