encode($string[, $key = ''])
Parameters: |
|
---|---|
Returns: |
Encrypted string |
Return type: |
string |
Performs the data encryption and returns it as a string. Example:
1 2 3 | $msg = 'My secret message' ; $encrypted_string = $this ->encrypt->encode( $msg ); |
You can optionally pass your encryption key via the second parameter if you don’t want to use the one in your config file:
1 2 3 4 | $msg = 'My secret message' ; $key = 'super-secret-key' ; $encrypted_string = $this ->encrypt->encode( $msg , $key ); |
Please login to continue.