phpQueryObject::index PHP Méthode

index() public méthode

..
public index ( $subject ) : integer
Résultat integer
    public function index($subject)
    {
        $index = -1;
        $subject = $subject instanceof self ? $subject->elements[0] : $subject;
        foreach ($this->newInstance() as $k => $node) {
            if ($node->isSameNode($subject)) {
                $index = $k;
            }
        }
        return $index;
    }