I have a bunch of HTML that is generated by a daemon using C, XML and XSL. Then I have a PHP script which picks up the HTML markup and displays it on the screen
I have a huge swathe of XHTML 1 compliant markup. I need to modify all of the links in the markup to remove &utm_source=report&utm_medium=email&utm_campaign=report
.
So far I've considered two options.
- Do a regex search in the PHP backend which trims out the Analytics code
- Write some Jquery to loop through the links and then trim out the Analytics code from the href.
Hurdles:
- The HTML can be HUGE. I.E. more than 4MB (ran some tests, they average at about 100Kb)
- It has to be fast.We get approximately 3K Thoughts?
Right now I'm trying to use str_replace('&utm_source=report&utm_medium=email&utm_campaign=report','',$html);
but it's not working.