maybe this is an old question but i’m trying as a personal experiment to fetch a page form the web and the make a copy out of it with all the relative urls, links, href, src etc withn absolute urls
i’m using CURL to fetch hte page and I have now a $html variable that contains all the code..
so what; the next step? shoud i use preg_replace? how?
thanks
The next step is to put it into a HTML parser and to walk the tree, looking for and fixing
hrefattributes onatags,srcattributes onimgtags, etc etc. The parser will be able to re-emit the tree as a string once you’re finished.