FluentDOM
[ class tree: FluentDOM ] [ index: FluentDOM ] [ all elements ]

Usage Example: FluentDOM::replaceAll()

  1. <?php
  2. /**
  3. *
  4. @version $Id: replaceAll.php 322 2009-09-14 20:19:48Z subjective $
  5. @license http://www.opensource.org/licenses/mit-license.php The MIT License
  6. @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
  7. */
  8. header('Content-type: text/plain');
  9.  
  10. $xml = <<<XML
  11. <html>
  12. <head></head>
  13. <body>
  14.   <div>
  15.     <p>Hello</p>
  16.     <p>cruel</p>
  17.     <p>World</p>
  18.   </div>
  19. </body>
  20. </html>
  21. XML;
  22.  
  23. require_once('../FluentDOM.php');
  24. $doc FluentDOM($xml);
  25. echo FluentDOM($xml)
  26.   ->node('<b id="sample">Paragraph. </b>')
  27.   ->replaceAll('//p');
  28. ?>

Documentation generated on Sun, 26 Sep 2010 01:00:50 +0200 by phpDocumentor 1.4.3