| @@ 248-260 (lines=13) @@ | ||
| 245 | * |
|
| 246 | * @return string |
|
| 247 | */ |
|
| 248 | public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string |
|
| 249 | { |
|
| 250 | // init |
|
| 251 | $text = ''; |
|
| 252 | ||
| 253 | if ($this->document->documentElement) { |
|
| 254 | foreach ($this->document->documentElement->childNodes as $node) { |
|
| 255 | $text .= $this->document->saveHTML($node); |
|
| 256 | } |
|
| 257 | } |
|
| 258 | ||
| 259 | return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity); |
|
| 260 | } |
|
| 261 | ||
| 262 | /** |
|
| 263 | * Get dom node's inner html. |
|
| @@ 269-281 (lines=13) @@ | ||
| 266 | * |
|
| 267 | * @return string |
|
| 268 | */ |
|
| 269 | public function innerXml(bool $multiDecodeNewHtmlEntity = false): string |
|
| 270 | { |
|
| 271 | // init |
|
| 272 | $text = ''; |
|
| 273 | ||
| 274 | if ($this->document->documentElement) { |
|
| 275 | foreach ($this->document->documentElement->childNodes as $node) { |
|
| 276 | $text .= $this->document->saveXML($node); |
|
| 277 | } |
|
| 278 | } |
|
| 279 | ||
| 280 | return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity); |
|
| 281 | } |
|
| 282 | ||
| 283 | /** |
|
| 284 | * Load HTML from string. |
|