There is an ancient PHP library called phpQuery that emulates jQuery semantics on the server side.
Even now it works surprisingly well, although it probably needs an overhaul to be compatible with PHP's HTML5 libxml compatibility.
github.com/punkave/phpQuery