Multi Array Counting By Key

Started on the old forum in December 2008 · view the original in the archive · old links redirect here

3 replies · 508 views · started 17 years ago · 1 min read

3 participants
Guest #1

I have a problem with array:

Array( [0] => Array ( [id] => 1 [time] => 1229109396 ) [1] => Array ( [id] => 2 [time] => 1229110705 ) )

and i want count arrays in array by time mytime>array time

sorry for my english 🙂

wizard Senior · 493 posts #3

QUOTE (Munis @ Dec 12 2008, 12:11 PM) <{POST_SNAPBACK}>

I have a problem with array:

Array( [0] => Array ( [id] => 1 [time] => 1229109396 ) [1] => Array ( [id] => 2 [time] => 1229110705 ) )

and i want count arrays in array by time mytime>array time

sorry for my english :)

Array( [0] => Array ( [id] => 1 [time] => 1229109396 ) [1] => Array ( [id] => 2 [time] => 1229110705 ))

U want to count what is in red?

djlee Developer · 224 posts #4

count number in array

count($array[0]) where $array is the outside wrapper (the first array)

and that goes for everything to do with arrays .. if you wanna add the vals together use array_sum($array[0]) e.c.t.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close