CI_Encrypt::encode()

encode($string[, $key = ''])

Parameters:
  • $string (string) – Data to encrypt
  • $key (string) – Encryption key
Returns:

Encrypted string

Return type:

string

Performs the data encryption and returns it as a string. Example:

$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:

$msg = 'My secret message';
$key = 'super-secret-key';

$encrypted_string = $this->encrypt->encode($msg, $key);
doc_CodeIgniter
2016-10-15 16:31:31
Comments
Leave a Comment

Please login to continue.