Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $str = '<ul class="top"><li><a href="[T]XX[/T]">Testing</a></li></ul>';
- $str = '<?xml encoding="utf-8" ?>'.$str;
- $dom = new DomDocument();
- @$dom->loadHTML($str);
- $xpath_menu_bottom = new DomXpath($dom);
- $x = $xpath_menu_bottom->query('(//ul[@class="top"])[1]')->item(0);
- var_dump($dom->saveHTML($x));
- ?>
Add Comment
Please, Sign In to add comment