PHP: How do I search an array for all entries of a specific key and return value?

groollaoneria

New Member
I've got a multidimentional array such as:\[code\]$array = array( array('test'=>23, 'one'=>'etc' , 'blah'=>'blah'), array('test'=>123, 'one'=>'etc' , 'blah'=>'blah'), array('test'=>33, 'one'=>'etc' , 'blah'=>'blah'),);\[/code\]How to I search the array for all the keys 'test' and get the value? I wish to add all of the values of 'test' found in the array, so it'd come up with '214' for example. The array should be any depth but the key will be the same no matter what.
 
Back
Top