Posted By

section31 on 01/11/10


Tagged


Versions (?)

nodeContent


 / Published in: PHP
 

This converts a dom node into a string. Why this is not native to the dom extension is beyond me.

  1. function nodeContent($n, $outer = false)
  2. {
  3. $d = new DOMDocument('1.0');
  4. $b = $d->importNode($n->cloneNode(true), true);
  5. $d->appendChild($b);
  6. $h = $d->saveHTML();
  7.  
  8. return $h;
  9. }

Report this snippet  

You need to login to post a comment.