Get Specific Data From Array, Based On Another Value

Posted by A Smith on Stack Overflow See other posts from Stack Overflow or by A Smith
Published on 2012-03-12T16:36:29Z Indexed on 2012/07/03 9:16 UTC
Read the original article Hit count: 240

Filed under:
|

I have an array that outputs these values:

Array ( 
    [0] => stdClass Object ( 
        [ID] => 6585
        [COLOR] => red 
        [Name] => steve
        ) 
    [1] => stdClass Object ( 
        [ID] => 5476 
        [COLOR] => blue 
        [Name] => sol
        ) 
    [2] => stdClass Object ( 
        [ID] => 7564 
        [COLOR] => yellow 
        [Name] => jake 
        ) 
    [3] => stdClass Object ( 
        [ID] => 3465 
        [COLOR] => green 
        [Name] => helen 
        ) 
    )

Now, I will know the ID of the person, and I need the get the COLOR value for that specific value set. How is this best achieved please?

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays