So I have this:
array(2) { [0]=> string(2) "cd" [1]=> string(6) "feegeg" }
And I have this code:
foreach ($elem as $key => $value) {
echo preg_replace('{(.)\1+}','$1',$value);
}
Which outputs:
cdfegeg
But I need it to output:
cdfeg
What do I need with preg_replace() or maybe not using preg_replace(), so I can get this output?