I'm currently using this HTML DOM PARSER using php : http://simplehtmldom.sourceforge.net/
I'm confused on how to remove and replace the selected attribute href="style.css"
, I want to replace the link with "index/style.css"
, should I insert only the
index/
or replace the whole attribute from the whole html code?
The official manual has several examples that basically cover all you need:
http://simplehtmldom.sourceforge.net/manual.htm
If you have issues with some specific step, feel free to update your question and provide some of your code.
This should do it:
You could also use PHP’s native DOM library: