Changing Header Image Every N Minutes/Seconds

To answer your question, in my opinion you would be way better using JavaScript. jQuery can be a great tool to do this. I would suggest installing the jQuery Cycle Plugin. into your theme. You can still load the images into your theme with PHP but if you want to change the image without needing to reload the page you’ll be best off using JavaScript.

Something like this:
Add jQuery and jQuery Cycle by adding this code to your functions.php

    <?php
function my_scripts_method() {
    wp_enqueue_script('jquery');
    wp_register_script( 'jcycle', 'http://ajax.aspnetcdn.com/ajax/jquery.cycle/2.99/jquery.cycle.all.min.js'); //register the Microsoft cdn copy of jcycle this could also be your local copy
    wp_enqueue_script('jcycle');
  }    

add_action('wp_enqueue_scripts', 'my_scripts_method'); //
?>

See wp enqueue script and Microsoft CDN for jCycle more info

Then add this to your header.php

<head>
<script type="text/javascript">
jQuery(document).ready(function($) {
    $('#header').cycle({
        fx: 'fade', //your effect
                random: 1, //make it random
                timeout: 5000 // change header every 5 seconds

    });
});
</script>
</head>
<body>
    <div id="Header">
        <img src="https://wordpress.stackexchange.com/questions/37393/beach1.jpg" width="200" height="200" />
        <img src="beach2.jpg" width="200" height="200" />
        <img src="beach3.jpg" width="200" height="200" />
    </div>
</body>

There are other jQuery/JavaScript slideshows/cycle plugins but I think this will get you on the right track