-
Notifications
You must be signed in to change notification settings - Fork 20
Nodes Item
Thomas Weinert edited this page Jul 29, 2014
·
2 revisions
DOMNode item(int $position);
Provides access to the node by its position in the internal list. Together with the $length
property this allows to access the nodes like in a DOMNodeList.
$fd = new FluentDOM\Nodes(
'<items><item/><item/><item/></items>'
);
$fd = $fd->find('//item');
$length = $fd->length;
for ($i = 0; $i < $length; $i++) {
$fd->item($i)->setAttribute('index', $i);
}
echo $fd;
<?xml version="1.0"?>
<items><item index="0"/><item index="1"/><item index="2"/></items>
- 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