FluentDOM\Nodes::toArray PHP Méthode

toArray() public méthode

Retrieve the matched DOM nodes in an array.
public toArray ( ) : DOMNode[]
Résultat DOMNode[]
    public function toArray()
    {
        return $this->_nodes;
    }

Usage Example

Exemple #1
0
 /**
  * @param string $expression
  * @param callable $filter
  * @param callable $stopAt
  * @param int $options
  * @throws \InvalidArgumentException
  * @return array
  */
 public function fetch($expression, callable $filter = NULL, callable $stopAt = NULL, $options = 0)
 {
     if ($this->validateContextIgnore($expression, $options)) {
         $nodes = $this->fetchFor($expression, NULL, $filter, $stopAt, $options);
     } else {
         $nodes = array();
         foreach ($this->_nodes->toArray() as $context) {
             $nodes = array_merge($nodes, $this->fetchFor($expression, $context, $filter, $stopAt, $options));
         }
     }
     return $this->unique($nodes, $options);
 }