/** * @param BotMsg $msg Wiadomość do przekonwertowania */ function __construct(BotMsg $msg) { $msg->a('<reset />'); $parser = $msg->getParser(); $this->html = $parser->saveXML($parser->getElementsByTagName('body')->item(0)); $this->html = (string) substr($this->html, 6, -7); }
/** * @param BotMsg $msg Wiadomość do przekonwertowania */ function __construct(BotMsg $msg) { $parser = $msg->getParser(); unset($msg); $this->parser = new DOMDocument('1.0', 'utf-8'); $this->parser->loadHTML('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body></body></html>'); $this->rewrite($parser->getElementsByTagName('body')->item(0), $this->parser->getElementsByTagName('body')->item(0)); unset($parser); $this->parse($this->parser->getElementsByTagName('body')->item(0)); $this->html = strtr((string) substr($this->parser->saveXML($this->parser->getElementsByTagName('body')->item(0)), 6, -7), array('/>' => '>')); }