php - 2 arrays, need the result to be what i show -


This is my array, I want this result below, but can not understand it.

The result is a number that is the number of times from the date of 2014-06-01 to the last day of the months 2014-06-xx

"My [1] "In my array with dates, there are incorrect dates in only 6-7-8.

1] => 2 [4] = & gt; 2 [7] => 3 [9] => 1 [12] => 1 [13] => 1)) Array ([0] = & gt; Array ([0] = & gt; 4 [1] => 4 [2] => 7 [3] => 1 [4] = & gt; 7 [5] = & gt; 7 [6] => 3 [7] => 3 [8] => 4 [9] => 9 [10] => 12 [11] ] = & Gt; 2 [12] => 13 [13] => 1) [1] => Array ([0] => 2014-06-18 [1] = & gt; ; 2014-06-10 [2] = & gt; 2014-06-05 [3] => 2014-06-05 [4] => 2014-06-12 [5] = & gt; 2014 -06-11 [6] = & gt; 2013-12-12 [7] = & gt; 2014-07-23 [8] = 2014-05-13 [9] => 2014-06 -01 [10] => 2014-06-12 [11] = & gt; 2014-06-04 [12] = & gt; 2014-06-04 [13] => 2014-06-11 ))

hope for the following actions Did not test it. $ idsArray = $ yourArray [0]; $ DateArray = $ yourArray [1]; $ CountArray = array (); // The result of the array $ start Tymestamp = strtotime ('2014-06-01'); $ Last Timestamp = Strottom ('2014-07-01'); // comes first as the last of July ($ id ra = $ key = & gt; $ id) of June (if (isset ($ dateArray [$ key])) {$ timestamp = strings ($ dateArray [$ Key]; if ($ timestamp> = $ launches keystamp & $ timestamp & lt; $ lastTimestamp) {if (isset ($ countArray [$ id])) {$ countArray [$ id] ++;} And {$ countArray [$ Id] = 1;}}}}

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -