PHP string manipulation functions are very counterintuitive and clunky, at least for me, and everytime I need to manipulate some html code before outputting it it takes too much time.
I was wondering if there was any PHP library that helps with this, preferably in a similar way to jQuery: retrieving and manipulating element attributes, selecting all the attributes with a given class, etc.
you can use phpquery or querypath. Here is a comprehensive tutorial about querypath.