I consider myself fairly bright, but anything but the simples regex goes swoosh over my head I'm afraid.
I'm trying to figure out a preg_replace to replace all image links and add a timestamp (the usual fool-the-cache trick). So what I am looking for is a regex that would take
blah blah blah <a href='blah>blah</a> blah <img src="http://blah.com/test.jpg" /> blah blah <a href="blah"><img src='/tester.jpg' /></a> blah blah
and make it into
blah blah blah <a href='blah>blah</a> blah <img src="http://blah.com/test.jpg?timestamp=123" /> blah blah <a href="blah"><img src='/tester.jpg?timestamp=123' /></a> blah blah.
Is it possible to do it in a single preg_replace? If not, any suggestions on the best way to do this?