_type = self::XMLRPC_TYPE_STRING; // Make sure this value is string and all XML characters are encoded $this->_value = $this->_xml_entities($value); } /** * Return the value of this object, convert the XML-RPC native string value into a PHP string * Decode all encoded risky XML entities back to normal characters * * @return string */ public function getValue() { return html_entity_decode($this->_value, ENT_QUOTES, 'UTF-8'); } /** * Make sure a string will be safe for XML, convert risky characters to HTML entities * * @param string $str * @return string */ private function _xml_entities($str) { return htmlentities($str, ENT_QUOTES, 'UTF-8'); } }