I have a logical structure or idea of something i want to happen and i wanted it to be coded in PHP using array, here's the scenario:
10 Loops/occurrence of month
month => repetition
jan => 2
mar => 1
sep => 5
dec => 2
As shown above i have a loop that occur 10 times, within that count of loops 4 different month have been recorded, and every specific month there is a chance that is has been repeated multiple times like the month (sep) has been repeated 5times. This idea is same as example a record of a person of what are the months he/she traveled and how many times he traveled within that month from 10 recorded travels. Any idea how to build this in PHP using Arrays? Any suggestions or answers are greatly appreciated!
Ok here's a real deal what i wanted to happen, i pull the records of months from a database, then i wanted to display the months pulled from database and the how many times it has been repeated, example the display are like these:
Jan (2)
Sep (5)
I wanted it to be dynamic, no certain month will be displayed if it doesn't exist from the database record.
array_count_values()
.