@retro: what he asks for is a sizzle-like library that works using PHP as a language instead of javascript, what you said about βno change to write thisβ is wrong, it's just code, you can write it as you wish.
However, the problem is that javascript running inside the browser gives you +1 up access to the DOM system, which can help you in creating a large number of dom / html nodes automatically, without having to do them yourself.
in php, the DOM just hurts, jquery happily hides it, and since javascript works differently than PHP, it can do it without much effort, however PHP does not have access to the browser DOM and has a different way of working, it is much more painful.
This does not mean that it is impossible, because it is simple, that it is not so simple, and sometimes another, when there is no clear reason why, I believe that the PHP DOM internally uses libXML or something similar, and provides too much part of this library is inside, so PHP gets clogged with the semantics of C library
I think you should look at phpQuery (https://github.com/TobiaszCudnik/phpquery) or even better in the active development of QueryPath (http://querypath.org).
however, do not expect them to be as light as the javascript javascript library, because it is not, unfortunately .....
Christopher thomas
source share