public static function simpleEncode($string, $passkey = null)
    {
        $key = $passkey;
        if (!isset($passkey) || empty($passkey)) {
            $key = self::generateServerSpecificHash();
        }

        $result = '';
        for ($i = 0; $i < strlen($string); $i++) {
            $char = substr($string, $i, 1);
            $keychar = substr($key, ($i % strlen($key)) - 1, 1);
            $char = chr(ord($char) + ord($keychar));
            $result .= $char;
        }

        return base64_encode($result);
    }
public static function simpleEncode($string, $passkey = null)
    {
        $key = $passkey;
        if (!isset($passkey) || empty($passkey)) {
            $key = self::generateServerSpecificHash();
        }

        $result = '';
        for ($i = 0; $i < strlen($string); $i++) {
            $char = substr($string, $i, 1);
            $keychar = substr($key, ($i % strlen($key)) - 1, 1);
            $char = chr(ord($char) + ord($keychar));
            $result .= $char;
        }

        return base64_encode($result);
    }
public static function simpleEncode ( $ string , $ passkey = null ) { $ key = $ passkey ; if ( ! isset ( $ passkey ) || empty ( $ passkey ) ) { $ key = self :: generateServerSpecificHash ( ) ; } $ result = '' ; for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i ++ ) { $ char = substr ( $ string , $ i , 1 ) ; $ keychar = substr ( $ key , ( $ i % strlen ( $ key ) ) - 1 , 1 ) ; $ char = chr ( ord ( $ char ) + ord ( $ keychar ) ) ; $ result .= $ char ; } return base64_encode ( $ result ) ; }
Simple Encode string.

@param string $string  String you would like to encode
@param string $passkey salt for encoding

@return string
Simple Encode string .