CI_Encrypt::decode()

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

Parameters:
  • $string (string) – String to decrypt
  • $key (string) – Encryption key
Returns:

Plain-text string

Return type:

string

Decrypts an encoded string. Example:

1
2
3
$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
 
$plaintext_string = $this->encrypt->decode($encrypted_string);

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->decode($msg, $key);
doc_CodeIgniter
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.