Fill missing days in data
I have an array which looks like this:

    $data = array(
        array('timestamp' => 1312776000, 'something' => 100), // data for 08.08.2011
        array('timestamp' => 1312862400, 'something' => 120), // data for 09.08.2011
        //  ????????                                          // data for 10.08.2011
        array('timestamp' => 1313035200, 'something' => 160), // data for 11.08.2011
        array('timestamp' => 1313121600, 'something' => 180), // data for 12.08.2011
        array('timestamp' => 1313208000, 'something' => 200), // data for 13.08.2011
        //  ????????                                          // data for 14.08.2011
        //  ????????                                          // data for 15.08.2011
        //  ????????                                          // data for 16.08.2011
        //  ????????                                          // data for 17.08.2011
        array('timestamp' => 1313640000, 'something' => 300), // data for 18.08.2011
    );

How to identify "holes" and fill them with a subarray with something = 0? As you can see, "holes" can be very large, that is why i was not able to solve this problem myself - my algorithm can fill only tiny "holes" (like 10.08.2011, but not 14.08.2011 -> 17.08.2011).
Fill missing days in data
===

I have an array which looks like this:

    $data = array(
        array('timestamp' => 1312776000, 'something' => 100), // data for 08.08.2011
        array('timestamp' => 1312862400, 'something' => 120), // data for 09.08.2011
        //  ????????                                          // data for 10.08.2011
        array('timestamp' => 1313035200, 'something' => 160), // data for 11.08.2011
        array('timestamp' => 1313121600, 'something' => 180), // data for 12.08.2011
        array('timestamp' => 1313208000, 'something' => 200), // data for 13.08.2011
        //  ????????                                          // data for 14.08.2011
        //  ????????                                          // data for 15.08.2011
        //  ????????                                          // data for 16.08.2011
        //  ????????                                          // data for 17.08.2011
        array('timestamp' => 1313640000, 'something' => 300), // data for 18.08.2011
    );

How to identify "holes" and fill them with a subarray with something = 0? As you can see, "holes" can be very large, that is why i was not able to solve this problem myself - my algorithm can fill only tiny "holes" (like 10.08.2011, but not 14.08.2011 -> 17.08.2011).