How to solve the problem of using php to complete the date in the array

Source: Internet
Author: User
Use php to complete the date in the array. if such an array is encountered, how does one fill in the period value of every time in the array; implement an array with 12 months for each large array (because sometimes there is no previous half year & nbsp; or the next half year's month), the value of each [period] & nbsp; complete as from (201301 ~ 201312. That is, from the beginning of the 1949th month, you can complete & nbsp; 01 ~ 0 use php to complete the date in the array
// If such an array is encountered, how to fill in the month that is missing for each period in the array so that each large array has an array of 12 months (because sometimes there is no month of the first half or the next half year ), the value of each [period] is filled with a value from (201301 ~ 201312.

That is, from the very beginning of the 1949th month ~ 04. If 01 ~ 09. sort every two-dimensional array by month.

Array
(
[0] => Array
(
[Period] = & gt; 201303
[Out_count] = & gt; 383
)

[1] => Array
(
[Period] = & gt; 201304
[Out_count] => 43
)

[2] => Array
(
[Period] = & gt; 201306
[Out_count] = & gt; 2859
)

[3] => Array
(
[Period] = & gt; 201307
[Out_count] = & gt; 251
)

[4] => Array
(
[Period] = & gt; 201309
[Out_count] = & gt; 807
)

)


// Get
Array
(
[0] => Array
(
[Period] = & gt; 201301
[Out_count] => 0
)

[1] => Array
(
[Period] = & gt; 201302
[Out_count] => 0
)

[2] => Array
(
[Period] = & gt; 201303
[Out_count] => 0
)

[3] => Array
(
[Period] = & gt; 201304
[Out_count] => 0
)

[4] => Array
(
[Period] = & gt; 201305
[Out_count] => 0
)

[5] => Array
(
[Period] = & gt; 201306
[Out_count] => 0
)

[6] => Array
(
[Period] = & gt; 201307
[Out_count] => 0
)

[7] => Array
(
[Period] = & gt; 201308
[Out_count] => 0
)
[8] => Array
(
[Period] = & gt; 201309
[Out_count] => 0
)

[9] => Array
(
[Period] = & gt; 201310
[Out_count] => 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.