Ver originalfunction removeRepeatedChars($str){$cNow = $str[0];$newStr = $str[0]; for($k=1;$k<strlen($str);$k++){ if($cNow != $str[$k]){ $newStr .= $str[$k]; $cNow = $str[$k]; } } return $newStr;}