-
Notifications
You must be signed in to change notification settings - Fork 20
Nodes Unique
Thomas Weinert edited this page Jul 29, 2014
·
1 revision
array unique(array $array);
Sorts an array of DOM nodes based on document position, in place, with the duplicates removed. Note that this only works on arrays of DOM nodes, not strings or numbers.
$fd = new FluentDOM\Nodes(
'<items><one/><two/><three/></items>'
);
$list = array_merge(
$fd->find('/items/*')->toArray(),
$fd->find('//*')->toArray()
);
var_dump(count($list), count($fd->unique($list)));int(7)
int(4)
- 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