public static function removeRepetitiveChar($string, $charToRemove = "", $max = 0, $replacement = "") { return preg_replace("/({$charToRemove}{{$max},})/", $replacement, $string); }