Countdown timer in PHP
Transferring data from a client to a server is an expensive procedure, and should be minimized as much as possible.  If the purpose of your PHP is to simply provide formatted time data, I would highly recommend letting your client do as much processing and formatting as possible

For example, what happens if the client loses internet connection?  The process will fail and the counter will not count down.

What if the connection to the server is slow or inconsistent?  The responses from the server may not return in the expected order, resulting in a countdown timer with unpredictable behavior.

Proposed solution:


PHP script processes date and returns UNIX timestamp
HTML page contains static divs with element IDs accessible to jQuery
On $(document).ready, only once, use the $.get function instead of $("#id").load to load the timestamp from the server and parse it as a Date object
Start your timer with a callback that processes the date and populates the div structure once per second.


Sample code, as requested:

recdisp.php:

&lt;?php
    date_default_timezone_set("Asia/KolKata");
    $time=1434402728+3600000*24*10000;//some time in future.
    echo $time;
?&gt;


timer.html:

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
&lt;script&gt;

    var timestamp;

    function updateClock() {
        console.log(timestamp);
        var date = new Date(timestamp*1000); // multiply by 1000 because Date() uses milliseconds

        // ...

        $("#seconds_div").html(date.getSeconds());
        timestamp -= 1; // decrement timestamp by 1 second.
    }

    // when the document is loaded, make an ajax call to load the timestamp
    $(document).ready(function(e) {
        $.get("recdisp.php", function(data) {
            timestamp = parseInt(data);
            setInterval(updateClock, 1000);
        });
    });

&lt;/script&gt;
&lt;/head&gt;

    &lt;body&gt;
       ...

       &lt;div class="d" id="seconds_div"&gt;&lt;/div&gt;
       &lt;div class="l"&gt;Seconds&lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;


I will let you fill in the blanks