-
Notifications
You must be signed in to change notification settings - Fork 20
Query Eq
Thomas Weinert edited this page Jul 30, 2014
·
1 revision
FluentDOM\Query eq(int $position);
Reduce the set of matched elements to a single element.
$html = <<<HTML
<html>
<head>
<title>Examples: FluentDOM\Query::eq()</title>
</head>
<body>
<div/>
<div/>
<div/>
<div/>
<div/>
<div/>
</body>
</html>
HTML;
echo FluentDOM($html, 'text/html')
->find('//div')
->eq(2)
->addClass('emphased');
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>Examples: FluentDOM\Query::eq()</title></head><body>
<div></div>
<div></div>
<div class="emphased"></div>
<div></div>
<div></div>
<div></div>
</body></html>
- 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