-
Notifications
You must be signed in to change notification settings - Fork 20
Nodes Traversable
Thomas Weinert edited this page Jul 30, 2014
·
2 revisions
FluentDOM\Nodes
implements the Traversable interface. More specific it implements IteratorAggregate.
The returned iterator is an recursive iterator. You can iterate the found nodes and their children.
$xml = <<<XML
<html>
<body>
<p>Hello</p>
<p>cruel</p>
<p>World</p>
</body>
</html>
XML;
foreach (FluentDOM($xml)->find('//p') as $key => $value) {
echo $key, ': ', $value, "\n";
}
0: Hello
1: cruel
2: World
- Home
- Getting Started
- Tasks
- Plugins
- Functions
- Lists
- Creator (5.1)
- CSS Selectors
- Convertors
- Loaders
- Serializers (5.1)
- Transformers (5.1)
- Extended DOM
- XMLReader (6.1)
- XMLWriter (6.1)
- Interfaces