public function getAndRemove($key)
    {
        $data = $this->get($key);
        if ($data) {
            $this->remove($key);
        }
        return $data;
    }
public function getAndRemove($key)
    {
        $data = $this->get($key);
        if ($data) {
            $this->remove($key);
        }
        return $data;
    }
public function getAndRemove ( $ key ) { $ data = $ this -> get ( $ key ) ; if ( $ data ) { $ this -> remove ( $ key ) ; } return $ data ; }
Return specific value by key and then clear it.

@param string $key

@return mixed|null
Return specific value by key and then clear it .