PHP:如何创建stdClass数组,并排序另一个02数组

I have two arrays as bellow,

  1. contains work hours for a given Task of a Project Structure. and information like below, [projectname] - name of the project

    [structurename] - name of structure (project has many structures)

    [taskname] - name of the Task (structures have many tasks)

    [taskstartdate] - starting date of the task

    [estimatedhours] - Estimated hours for the task

    [hours] - number of hours an employee worked on the task

    [createdon] - the date that employee worked number of hours

    Array ( [0] => stdClass Object ( [projectname] => test p1 [structurename] => test structure [taskname] => task [taskstartdate] => 2016-02-02 00:00:00 [estimatedhours] => 10.00 [hours] => 5.00 [createdon] => 2016-02-03 07:38:08 )
            [1] => stdClass Object ( [projectname] => test p1 [structurename] => test structure [taskname] => task [taskstartdate] => 2016-02-02 00:00:00 [estimatedhours] => 10.00 [hours] => 2.00 [createdon] => 2016-02-04 14:21:34 )
            [2] => stdClass Object ( [projectname] => p2 [structurename] => struc [taskname] => p2t1 [taskstartdate] => 2016-02-03 00:00:00 [estimatedhours] => 8.00 [hours] => 2.00 [createdon] => 2016-02-04 11:05:31 )
            [3] => stdClass Object ( [projectname] => p2 [structurename] => struc [taskname] => p2t1 [taskstartdate] => 2016-02-03 00:00:00 [estimatedhours] => 8.00 [hours] => 6.00 [createdon] => 2016-02-05 08:00:22 )
            [4] => stdClass Object ( [projectname] => web dev [structurename] => dev test [taskname] => dev task [taskstartdate] => 2016-02-04 00:00:00 [estimatedhours] => 30.00 [hours] => 8.00 [createdon] => 2016-02-04 08:21:14 ))
    
  2. The second array contains days for a given week (in this case, first week of the 2016, February)

    Array ( [0] => 2016-02-01
            [1] => 2016-02-02
            [2] => 2016-02-03
            [3] => 2016-02-04
            [4] => 2016-02-05 )
    

Using the both above arrays I want to create one single array object as below, The idea behind this is to create one row of array for one project and add worked hours for given 05 days. The description of the expected array as below,

[name] - Combination of [projectname] | [structurename] | [taskname] of the very first array

[taskstartdate] - Task start date from the first array

[estimatedhours] - Estimated hours from the first array

[01] - Get 01 from 2016-02-01 and add as key, from the second array

[02] - Get 02 from 2016-02-02 and add as key, from the second array

[03] => 5.00 - Get 03 from 2016-02-03 and add as key, from the second array and also add 5.00 as value.

This is because of the first array [hours] = > 5.00 [createdon] => 2016-02-03 07:38:08 which means an employee has worked 5 hours on 2016-02-03 so it should be added as the value.

[04] => 2.00 - according to the [1] => stdClass Object of the first array employee has worked on the same project 2.00 hour on 2016-02-04

 Array ( [0] => stdClass Object ( [name] => test p1 | test structure | task [taskstartdate] => 2016-02-02 00:00:00 [estimatedhours] => 10.00    [01] => 0 [02] => 0 [03] => 5.00 [04] => 2.00 [05] => 0)
         [1] => stdClass Object ( [name] => p2 | struc | p2t1               [taskstartdate] => 2016-02-03 00:00:00 [estimatedhours] => 8.00     [01] => 0 [02] => 0 [03] => 0 [04] => 2.00 [05] => 6.00 )
         [2] => stdClass Object ( [name] => web dev | dev test | dev task   [taskstartdate] => 2016-02-04 00:00:00 [estimatedhours] => 30.00    [01] => 0 [02] => 0 [03] => 0 [04] => 8.00 [05] => 6.00)

I hope you can understand the logic and please comment if need more information for this.

This is beyond my understanding so I did not tryout code for this.

Best regards.