Nodes ToArray - ThomasWeinert/FluentDOM GitHub Wiki
array toArray();
Returns the found nodes as an array.
$xml = <<<XML
<html>
<head>
<title>Examples: FluentDOM\Nodes::toArray()</title>
</head>
<body>
<p>Hello</p>
<p>cruel</p>
<p>World</p>
</body>
</html>
XML;
$nodes = FluentDOM($xml)->find('//p')->toArray();
array_splice($nodes, 1, 1);
echo implode(' ', $nodes);
Hello World