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

Usage Example: FluentDOM::wrap()

  1. <?php
  2. /**
  3. *
  4. @version $Id: wrap.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.   <p>Hello</p>
  15.   <p>cruel</p>
  16.   <p>World</p>
  17. </body>
  18. </html>
  19. XML;
  20.  
  21. require_once('../FluentDOM.php');
  22.  
  23. echo FluentDOM($xml)
  24.   ->find('//p')
  25.   ->wrap('<div class="outer"><div class="inner"></div></div>');
  26. ?>

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