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?
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?