public static function eliminateDupilcates($subject, $eliminate = "\\")
    {
        $pattern = $eliminate . $eliminate;

        while (strpos($subject, $pattern) !== false) {
            $subject = str_replace($pattern, $eliminate, $subject);
        }

        return $subject;
    }
public static function eliminateDupilcates($subject, $eliminate = "\\")
    {
        $pattern = $eliminate . $eliminate;

        while (strpos($subject, $pattern) !== false) {
            $subject = str_replace($pattern, $eliminate, $subject);
        }

        return $subject;
    }
public static function eliminateDupilcates ( $ subject , $ eliminate = "\\" ) { $ pattern = $ eliminate . $ eliminate ; while ( strpos ( $ subject , $ pattern ) !== false ) { $ subject = str_replace ( $ pattern , $ eliminate , $ subject ) ; } return $ subject ; }
Eliminate a duplicate given phrase from a given string

@param string $subject
@param string $eliminate

@return string
Eliminate a duplicate given phrase from a given string