- 
                Notifications
    You must be signed in to change notification settings 
- Fork 20
Nodes Index
        Thomas Weinert edited this page Jul 29, 2014 
        ·
        2 revisions
      
    int index([ NULL|string|\DOMNode|\Traversable $selector = NULL ]);
The function has two modes. If a $selector is provided. It searches for that
element in the internal list and returns it index.
If the $selector is NULL it returns the index of the first node from the internal list in its parent elements child nodes list.
$xml = <<<'XML'
<items>
  <item>One</item>
  <item>Two</item>
  <item>Three</item>
</items>
XML;
echo FluentDOM($xml)
  ->find('//item[contains(.,"Two")]')
  ->index();1- 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