PageRenderTime 53ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/empty.php

http://github.com/ThomasWeinert/FluentDOM
PHP | 24 lines | 16 code | 2 blank | 6 comment | 0 complexity | aaf383a99d875c1d854b7d5bdcfd6e9d MD5 | raw file
  1. <?php
  2. /**
  3. *
  4. * @version $Id$
  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. $xml = <<<XML
  10. <html>
  11. <head></head>
  12. <body>
  13. <p class="first">Hello One</p>
  14. <p>Hello Two</p>
  15. </body>
  16. </html>
  17. XML;
  18. require_once('../src/FluentDOM.php');
  19. echo FluentDOM($xml)
  20. ->find('//p[@class = "first"]')
  21. ->empty();
  22. ?>