protected function _censorCallback($matches) {
        $length = mb_strlen(trim($matches[0]));
        $censored = '';
        $symbols = str_shuffle('*@#$*!?%');
        $i = 0;
        $s = 0;

        if ($length > 10) {
            $length = 10;
        }

        while ($i < $length) {
            $censored .= $symbols[$s];

            $i++;
            $s++;

            if ($s > 7) {
                $s = 0;
            }
        }

        return $censored;
    }
protected function _censorCallback($matches) {
        $length = mb_strlen(trim($matches[0]));
        $censored = '';
        $symbols = str_shuffle('*@#$*!?%');
        $i = 0;
        $s = 0;

        if ($length > 10) {
            $length = 10;
        }

        while ($i < $length) {
            $censored .= $symbols[$s];

            $i++;
            $s++;

            if ($s > 7) {
                $s = 0;
            }
        }

        return $censored;
    }
protected function _censorCallback ( $ matches ) { $ length = mb_strlen ( trim ( $ matches [ 0 ] ) ) ; $ censored = '' ; $ symbols = str_shuffle ( '*@#$*!?%' ) ; $ i = 0 ; $ s = 0 ; if ( $ length > 10 ) { $ length = 10 ; } while ( $ i < $ length ) { $ censored .= $ symbols [ $ s ] ; $ i ++ ; $ s ++ ; if ( $ s > 7 ) { $ s = 0 ; } } return $ censored ; }
Censor a word if its only by itself.

@param array $matches
@return string
Censor a word if its only by itself .