Utils/StringUtils.php
/**
     * Encodes text randomly to html entities of different styles
     * This code comes from Symfony 1.4
     *
     * @param string $text
     * @return string
     */
Encodes text randomly to html entities of different styles
This code comes from Symfony 1.4

@param string $text
@return string
Encodes text randomly to html entities of different styles This code comes from Symfony 1 . 4 @param string $text @return string
public static function encodeText($text)
    {
        $encoded_text = '';
        for ($i = 0; $i < strlen($text); $i++) {
            $char = $text{$i};
            $r    = rand(0, 100);
            if ($r > 90 && $char != '@') {
                $encoded_text .= $char;
            } else if ($r < 45) {
                $encoded_text .= '&#x' . dechex(ord($char)) . ';';
            } else {
                $encoded_text .= '&#' . ord($char) . ';';
            }
        }
        return $encoded_text;
    }
public static function encodeText ( $ text ) { $ encoded_text = '' ; for ( $ i = 0 ; $ i < strlen ( $ text ) ; $ i ++ ) { $ char = $ text { $ i } ; $ r = rand ( 0 , 100 ) ; if ( $ r > 90 && $ char != '@' ) { $ encoded_text .= $ char ; } else if ( $ r < 45 ) { $ encoded_text .= '&#x' . dechex ( ord ( $ char ) ) . ';' ; } else { $ encoded_text .= '&#' . ord ( $ char ) . ';' ; } } return $ encoded_text ; }
Encodes text randomly to html entities of different styles
 This code comes from Symfony 1.4
Encodes text randomly to html entities of different styles This code comes from Symfony 1 . 4
# roughly 10% raw, 45% hex, 45% dec # '@' *must* be encoded. I insist.