CI_Encrypt::decode PHP Method

decode() public method

Reverses the above process
public decode ( $string, $key = '' ) : string
return string
    public function decode($string, $key = '')
    {
        if (preg_match('/[^a-zA-Z0-9\\/\\+=]/', $string) or base64_encode(base64_decode($string)) !== $string) {
            return FALSE;
        }
        return $this->mcrypt_decode(base64_decode($string), $this->get_key($key));
    }

Usage Example

示例#1
0
 private function _session_read()
 {
     if (empty($this->_session)) {
         $config = get_config();
         $session = filter_input(INPUT_COOKIE, $config['sess_cookie_name']);
         require_once BASEPATH . 'libraries/Encrypt.php';
         $encrypt = new CI_Encrypt();
         $this->_session = unserialize($encrypt->decode($session, $config['encryption_key']));
     }
     return $this->_session;
 }
All Usage Examples Of CI_Encrypt::decode