php array recursive sum

Hard2Beat

New Member
I have an array like this:\[code\]Array( [1000] => Array ( [pv] => 36 ) [1101] => Array ( [1102] => Array ( [pv] => 92 ) [pv] => 38 ) [pv] => 64)\[/code\]How I can find the sum of all array elements with key 'pv', regardless of the depth at which they appear.For this example the result will \[code\]36+92+38+64 = 240\[/code\]Thanks for help.
 
Back
Top