$simpledom = new SimpleDOM();
$simpledom
->element('ul', array('class' => 'menu'))
->element('li', array('id' => 'list_1'))
->element('a', array('href' => 'my_list_1.html'), 'Click Here')->up()
->up()
->element('li', array('id' => 'list_2'))
->text("free text")
->comment("my comment");
$domDocument = $simpledom->getDOMDocument();
echo $domDocument->saveHTML();
<ul class="menu">
<li id="list_1">
<a href="my_list_1.html">Click Here</a>
</li>
<li id="list_2">free text<!--my comment--></li>
</ul>
-
Notifications
You must be signed in to change notification settings - Fork 0
chentepixtol/simpledom
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Handle Documents DOM very easy
Resources
Stars
Watchers
Forks
Packages 0
No packages published