How would you add a class named newClass
to an opening tag like <a class='abc'>
or <p style=display:block>
using php?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- how to split a list into a given number of sub-lis
- Can php detect if javascript is on or not?
Html class from Nette Framework does a perfect work for generating HTML tags in PHP.
Regexp example:
using http://php.net/manual/en/book.dom.php example
I'm purposely not using
loadHTML
(inside the function) to prevent having to dive down into the autogenerated html structure to find the actual given$htmlString
. This of course implies that$htmlString
has to be well-formed.