Ie has issues. Within this situation, caching issues. Images which have been saved to my server, and therefore are recommended during my dynamically produced site (WordPress) display like a "red-colored x" in IE8 when individuals images are modified in some way, however the URI from the image is not transformed within the code, sometimes.

After I do alter the URI of those assets, the pictures display correctly in IE. I therefore wish to append a somewhat unique query string towards the finish of my image URI's (a.k.a. change "graphic.png" to "graphic.png?d=a334bc4zxdg2" (if randomized) or "graphic.png?d=201103091616" (if dated). I'm not picky in regards to a randomized query string or "dated" query string - just like lengthy as it is a pleasant lengthy query string appended towards the finish of .PNG and .Digital filetypes.

I've tried to write my very own, and am thus very humbled. I figure this is resolved having a preg_replace statement... something like

<php
echo preg_replace('(png|jpg)', '$1.?d.=<the-randomizing-or-timestamp-code>','some-subject-I-dont-know-how-to-specify')
?>

As you have seen previously mentioned, I want plenty of help penning this code. Please be aware, I'm operating in WordPress, which utilizes some unique hooks, and I am attempting to apply this fully content from the body. Thanks SO!

== Update ==

A buddy indicates the next:

// Append PNG files with timestamp query string
function date_images () {
    $new_content = str_replace (".png" ,".png?id=".time() ,$original_content);
    }

add_filter('the_content', 'date_images');

Is the fact that on the right track? It does not work correctly in Wordpress, but helps make the content element entirely disappear. Interesting help...

Basically understand you right, you can simply do:

echo $variable.'?d='time();

To append a unixtime stamp towards the finish from the string.

You'd be best applying this like a client side fix to ensure that non-IE customers could get the standard image Web addresses.

I'd do this:

<script type="text/javascript" src="PATH-TO-JQUERY"></script>
<script type="text/javascript">
// document.all is IE only
if ( document.all )
{
    $(document).ready(function(){
        // grab each image
        $('img').each(function(){
            var date = new Date;
            // add the current unix timestamp in microseconds to the the image src as a query string
            this.src = this.src + '?' + date.getTime();
        });
    });
}
</script>

<img src="image1.gif" />
<img src="image2.gif" />
<img src="image3.gif" />