0

Im using paquettg/php-html-parser to parse html jquery style in php.

I fail to find the function similiar to jquery's next(). For instance the equivalent to next("p") in below jquery:

var string=$("span#a").parent().next("p").text();

Is there one?

1 Answer 1

1

I think what you're looking for in PHP is the DOMElement class. Specifically, I think you're looking for the DOMNode() method.

This method finds the node immediately following this node. If there is no such node, this returns NULL.

I might recommend looking at this ticket for an example of how you can implement this method to accomplish your task Select the next node of the selected node in PHP DOM?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.