protected function encode($originalString)
    {
        $encodedString = '';
        $nowCodeString = '';
        $originalLength = strlen($originalString);
        for ($i = 0; $i < $originalLength; $i++) {
            $encodeMode = ($i % 2 == 0) ? 1 : 2; // Switch encoding odd/even
            switch ($encodeMode) {
                case 1: // Decimal code
                    $nowCodeString = '&#' . ord($originalString[$i]) . ';';
                    break;
                case 2: // Hexadecimal code
                    $nowCodeString = '&#x' . dechex(ord($originalString[$i])) . ';';
                    break;
                default:
                    return 'ERROR: wrong encoding mode.';
            }
            $encodedString .= $nowCodeString;
        }
        return $encodedString;
    }
protected function encode($originalString)
    {
        $encodedString = '';
        $nowCodeString = '';
        $originalLength = strlen($originalString);
        for ($i = 0; $i < $originalLength; $i++) {
            $encodeMode = ($i % 2 == 0) ? 1 : 2; // Switch encoding odd/even
            switch ($encodeMode) {
                case 1: // Decimal code
                    $nowCodeString = '&#' . ord($originalString[$i]) . ';';
                    break;
                case 2: // Hexadecimal code
                    $nowCodeString = '&#x' . dechex(ord($originalString[$i])) . ';';
                    break;
                default:
                    return 'ERROR: wrong encoding mode.';
            }
            $encodedString .= $nowCodeString;
        }
        return $encodedString;
    }
protected function encode ( $ originalString ) { $ encodedString = '' ; $ nowCodeString = '' ; $ originalLength = strlen ( $ originalString ) ; for ( $ i = 0 ; $ i < $ originalLength ; $ i ++ ) { $ encodeMode = ( $ i % 2 == 0 ) ? 1 : 2 ; // Switch encoding odd/even switch ( $ encodeMode ) { case 1 : // Decimal code $ nowCodeString = '&#' . ord ( $ originalString [ $ i ] ) . ';' ; break ; case 2 : // Hexadecimal code $ nowCodeString = '&#x' . dechex ( ord ( $ originalString [ $ i ] ) ) . ';' ; break ; default : return 'ERROR: wrong encoding mode.' ; } $ encodedString .= $ nowCodeString ; } return $ encodedString ; }
Obscure email address.

@param string The email address
@return string The encoded (ASCII & hexadecimal) email address
Obscure email address .